We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I was looking to try to use a dualport bram with byte masking.
Created this file: dualport_bram_wmask_byte.v.in in the templates directory:
// SL 2019, MIT license module %MODULE%( input [%WENABLE0_WIDTH%-1:0] in_%NAME%_wenable0, input %DATA_TYPE% [%DATA_WIDTH%-1:0] in_%NAME%_wdata0, input [%ADDR0_WIDTH%-1:0] in_%NAME%_addr0, input [%WENABLE1_WIDTH%-1:0] in_%NAME%_wenable1, input [%DATA_WIDTH%-1:0] in_%NAME%_wdata1, input [%ADDR1_WIDTH%-1:0] in_%NAME%_addr1, output reg %DATA_TYPE% [%DATA_WIDTH%-1:0] out_%NAME%_rdata0, output reg %DATA_TYPE% [%DATA_WIDTH%-1:0] out_%NAME%_rdata1, input %CLOCK%0, input %CLOCK%1 ); (* no_rw_check *) reg %DATA_TYPE% [%DATA_WIDTH%-1:0] buffer[%DATA_SIZE%-1:0]; always @(posedge %CLOCK%0) begin out_%NAME%_rdata0 <= buffer[in_%NAME%_addr0]; out_%NAME%_rdata1 <= buffer[in_%NAME%_addr1]; end integer i; always @(posedge %CLOCK%0) begin for (i = 0; i < (%DATA_WIDTH%)/8; i = i + 1) begin if (in_%NAME%_wenable0[i]) begin buffer[in_%NAME%_addr0][i*8+:8] <= in_%NAME%_wdata0[i*8+:8]; end if (in_%NAME%_wenable1[i]) begin buffer[in_%NAME%_addr1][i*8+:8] <= in_%NAME%_wdata1[i*8+:8]; end end end %INITIAL% endmodule
However testing, via verilator, when invoked via
$$config['dualport_bram_wmask_byte_wenable0_width'] = 'data' $$config['dualport_bram_wmask_byte_wenable1_width'] = 'data' dualport_bram uint16 ram<"dualport_bram_wmask_byte"> [16384] = {file("ROM/VBIOS.bin"), pad(uninitialized)};
always gives ram.rdata1 as 0x0000.
Would be a useful enhancement, if you can correct any errors in the above?
The text was updated successfully, but these errors were encountered:
Apologies, the error was elsewhere, was truncating the readdata elsewhere to 16 bit. The above works in verilator. Will test on hardware.
Rob.
Sorry, something went wrong.
No branches or pull requests
I was looking to try to use a dualport bram with byte masking.
Created this file: dualport_bram_wmask_byte.v.in in the templates directory:
However testing, via verilator, when invoked via
always gives ram.rdata1 as 0x0000.
Would be a useful enhancement, if you can correct any errors in the above?
The text was updated successfully, but these errors were encountered: