Skip to content

Commit 7358ae1

Browse files
Convert flops back to combinational logic, selecting 0 for states that were previously latch holds
1 parent eacf45f commit 7358ae1

File tree

1 file changed

+24
-10
lines changed

1 file changed

+24
-10
lines changed

vtr_flow/benchmarks/verilog/ch_intrinsics.v

Lines changed: 24 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,28 @@ reg [`MEMORY_CONTROLLER_TAG_SIZE-1:0] prevTag;
4747
always @(posedge clk)
4848
prevTag <= tag;
4949

50-
always @(posedge clk)
50+
always @(*)
5151
begin
5252
if (~tag)
5353
begin
54-
str_address <= memory_controller_address[4:0];
55-
str_write_enable <= memory_controller_write_enable;
56-
str_in[7:0] <= memory_controller_in[7:0];
54+
str_address = memory_controller_address[4:0];
55+
str_write_enable = memory_controller_write_enable;
56+
str_in[7:0] = memory_controller_in[7:0];
5757
end
58+
else
59+
begin
60+
str_address = 5'h0;
61+
str_write_enable = 1'b0;
62+
str_in[7:0] = 8'h0;
63+
end
5864
end
5965

60-
always @(posedge clk)
66+
always @(*)
6167
begin
6268
if (~prevTag)
63-
memory_controller_out <= str_out;
69+
memory_controller_out = str_out;
70+
else
71+
memory_controller_out = 'h0;
6472
end
6573

6674
endmodule
@@ -272,15 +280,21 @@ case(cur_state)
272280
end
273281
endcase
274282

275-
always @(posedge clk)
283+
always @(*)
276284
begin
277285

278286
if (cur_state == 4'b1101)
279287
begin
280-
memory_controller_address <= s_07;
281-
memory_controller_write_enable <= 1'b1;
282-
memory_controller_in <= c;
288+
memory_controller_address = s_07;
289+
memory_controller_write_enable = 1'b1;
290+
memory_controller_in = c;
283291
end
292+
else
293+
begin
294+
memory_controller_address = 'h0;
295+
memory_controller_write_enable = 1'b0;
296+
memory_controller_in = 'h0;
297+
end
284298

285299
end
286300

0 commit comments

Comments
 (0)