3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2025-04-07 01:54:10 +00:00

Merge pull request #4783 from YosysHQ/emil/blockrom-driver-conflict

tests: fix blockrom.v driver conflict
This commit is contained in:
Emil J 2024-12-03 16:29:43 +01:00 committed by GitHub
commit 52336369fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -10,8 +10,11 @@ module sync_rom #(parameter DATA_WIDTH=8, ADDRESS_WIDTH=10)
reg [WORD:0] data_out_r; reg [WORD:0] data_out_r;
reg [WORD:0] memory [0:DEPTH]; reg [WORD:0] memory [0:DEPTH];
integer i,j = 64'hF4B1CA8127865242; integer i,j;
initial // Initialize in initial block as a workaround for
// https://github.com/YosysHQ/yosys/issues/4792
initial begin
j = 64'hF4B1CA8127865242;
for (i = 0; i <= DEPTH; i++) begin for (i = 0; i <= DEPTH; i++) begin
// In case this ROM will be implemented in fabric: fill the memory with some data // In case this ROM will be implemented in fabric: fill the memory with some data
// uncorrelated with the address, or Yosys might see through the ruse and e.g. not // uncorrelated with the address, or Yosys might see through the ruse and e.g. not
@ -21,6 +24,7 @@ module sync_rom #(parameter DATA_WIDTH=8, ADDRESS_WIDTH=10)
j = j ^ (j << 25); j = j ^ (j << 25);
j = j ^ (j >> 27); j = j ^ (j >> 27);
end end
end
always @(posedge clk) begin always @(posedge clk) begin
data_out_r <= memory[address_in]; data_out_r <= memory[address_in];