aboutsummaryrefslogtreecommitdiff
path: root/src/rtl/rosc.v
diff options
context:
space:
mode:
authorJoachim StroĢˆmbergson <joachim@secworks.se>2014-09-24 09:46:17 +0200
committerJoachim StroĢˆmbergson <joachim@secworks.se>2014-09-24 09:46:17 +0200
commit071ea1d8114b786615068b47f83571b8ec16e001 (patch)
tree48d960e3fdee2153691759466375ff2b256afd5a /src/rtl/rosc.v
parent2f468f182027217e72c08e684d32e4450917f5a4 (diff)
Updates to fix bugs found during synthesis. Adding more debug outputs in API. Adding security error port for future internal health tests.
Diffstat (limited to 'src/rtl/rosc.v')
-rw-r--r--src/rtl/rosc.v14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/rtl/rosc.v b/src/rtl/rosc.v
index afcc9bf..5557353 100644
--- a/src/rtl/rosc.v
+++ b/src/rtl/rosc.v
@@ -55,13 +55,7 @@ module rosc #(parameter WIDTH = 2)
// Registers.
//----------------------------------------------------------------
reg dout_reg;
-
-
- //----------------------------------------------------------------
- // Wires.
- //----------------------------------------------------------------
- reg [WIDTH : 0] sum;
- reg cin;
+ reg dout_new;
//----------------------------------------------------------------
@@ -83,7 +77,7 @@ module rosc #(parameter WIDTH = 2)
begin
if (we)
begin
- dout_reg <= cin;
+ dout_reg <= dout_new;
end
end
end
@@ -99,8 +93,12 @@ module rosc #(parameter WIDTH = 2)
//----------------------------------------------------------------
always @*
begin: adder_osc
+ reg [WIDTH : 0] sum;
+ reg cin;
+
cin = ~sum[WIDTH];
sum = opa + opb + cin;
+ dout_new = sum[WIDTH];
end
endmodule // rosc