Project

General

Profile

[logo] 
 
Home
News
Activity
About/Contact
Major Tools
  Dinotrace
  Verilator
  Verilog-mode
  Verilog-Perl
Other Tools
  BugVise
  CovVise
  Force-Gate-Sim
  Gspice
  IPC::Locker
  Rsvn
  SVN::S4
  Voneline
  WFH
General Info
  Papers

Issue #1266

Issue with behavioural SRAM model bigger than 64-bit

Added by Florian Zaruba over 1 year ago. Updated over 1 year ago.

Status:
NoFixNeeded
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%


Description

Hi,

I am having an issue with my behavioural SRAM model:
module sram #(
    int unsigned DATA_WIDTH = 64,
    int unsigned NUM_WORDS  = 1024
)(
   input  logic                          clk_i,

   input  logic                          req_i,
   input  logic                          we_i,
   input  logic [$clog2(NUM_WORDS)-1:0]  addr_i,
   input  logic [DATA_WIDTH-1:0]         wdata_i,
   input  logic [DATA_WIDTH-1:0]         be_i,
   output logic [DATA_WIDTH-1:0]         rdata_o
);
    localparam ADDR_WIDTH = $clog2(NUM_WORDS);

    logic [DATA_WIDTH-1:0] ram [NUM_WORDS-1:0];
    logic [ADDR_WIDTH-1:0] raddr_q;

    always_ff @(posedge clk_i) begin
        if (req_i) begin
            if (!we_i)
                raddr_q <= addr_i;
            else
                for (int i = 0; i < DATA_WIDTH; i++)
                    if (be_i[i]) ram[addr_i][i] <= wdata_i[i];
        end
    end

    assign rdata_o = ram[raddr_q];

endmodule

The interesting thing: When compiling with default parameter values e.g.: 64-bit and below everything works fine. When increasing the loop count to 65 and above I am getting

Error-BLKLOOPINIT: src/util/behav_sram.sv:42: Unsupported: Delayed assignment to array inside for loops (non-delayed is ok - see docs)

which seems to suggest that something is incorrect with the loop unrolling. It seems to be quite an artificial limitation that is the reason why I am posting here.

Thanks, Florian

History

#1 Updated by Wilson Snyder over 1 year ago

  • Project changed from Verilog-Perl to Verilator
  • Status changed from New to NoFixNeeded

Use --unroll-count 256

Note this is why it says to see the documentation ;)

Also available in: Atom