3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-06 01:24:10 +00:00
yosys/tests/simple/mem2reg_bounds_tern.v
Claire Xenia Wolf 15fb0107dc Fix "make vgtest" so it runs to the end (but now it fails ;)
Signed-off-by: Claire Xenia Wolf <claire@clairexen.net>
2021-09-23 14:54:28 +02:00

20 lines
418 B
Verilog

module mem2reg_bounds_term_top(
input clk,
input wire [1:0] sel,
input wire [7:0] base,
output reg [7:0] line
);
reg [0:7] mem [0:2];
generate
genvar i;
for (i = 0; i < 4; i = i + 1) begin : gen
always @(posedge clk)
mem[i] <= i == 0 ? base : mem[i - 1] + 1;
end
endgenerate
always @(posedge clk)
line = mem[sel];
endmodule