Forum Discussion

zjj's avatar
zjj
Icon for New Contributor rankNew Contributor
8 hours ago

memory infer

in my project that base agilex7 fpga,  I need to use bit mask memory.   the bit mask memory rtl behavior as follow. as quartus only support byte mask memory, so I think quartus tool should use logic(ALM registers) implementation instead of M20K.  However,  the fitter technology map shows that the following rtl behaviors is mapping to the M20k, that cause rtl behavior is inconsistent with fitter netlist.  is this quartus eda bug?

always @(posedge clk) begin

if (ram_wra) data[ram_addra] <= (data[ram_addra] & ~ram_bwma) | (wrp_dina & ram_bwma);

end

always @(posedge clk) begin

if (ram_rdb) wrp_doutb <= data[addrb];

end

 

1 Reply

  • FvM's avatar
    FvM
    Icon for Super Contributor rankSuper Contributor

    Hi,

    the code is describing read-modify-write action that can be basically implemented with M20K block ram. Due to synchronous operation ram_addra is evaluated in different cycles for read and write, shown simple behavioral code is possibly not working as expected.

    Question is if you require write to different address every clock cycle, in this case pipelined implementation with Agilex quad port mode can achieve the required functionality. But I doubt that it can be simply inferred.

    Regards Frank