-
Notifications
You must be signed in to change notification settings - Fork 71
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Himbaechel. Add BSRAM for all chips.
The following primitives are implemented for the GW1N-1, GW2A-18, GW2AR-18C, GW1NSR-4C, GW1NR-9C, GW1NR-9 and GW1N-4 chips: * pROM - read only memory - (bitwidth: 1, 2, 4, 8, 16, 32). * pROMX9 - read only memory - (bitwidth: 9, 18, 36). * SDPB - semidual port - (bitwidth: 1, 2, 4, 8, 16, 32). * SDPX9B - semidual port - (bitwidth: 9, 18, 36). * DPB - dual port - (bitwidth: 16). * DPX9B - dual port - (bitwidth: 18). * SP - single port - (bitwidth: 1, 2, 4, 8, 16, 32). * SPX9 - single port - (bitwidth: 9, 18, 36). For GW1NSR-4C and GW1NR-9 chips, SP/SPX9 primitives with data widths of 32/36 bits are implemented using a pair of 16-bit wide primitives. Added examples for all boards except those based on GW1NSR-4C, GW1NR-9 and GW1N-4 chips for memory primitives with a width of 8 bits (as well as 16 bits where 8 is not supported). And these very examples are the weakest point - I tried to make the primitives themselves work and the result of compiling the examples was similar between the vendor IDE and Apicula, but the examples themselves were poorly written. This is due to my lack of experience working with BSRAM. In general, they need to be rewritten. Signed-off-by: YRabbit <[email protected]>
- Loading branch information
Showing
41 changed files
with
2,826 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pROM-image-rom.v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
`default_nettype none | ||
module video_ram( | ||
input wire clk, | ||
input wire reset, | ||
input wire write_clk, | ||
input wire write_reset, | ||
input wire write_ce, | ||
input wire read_wre, | ||
input wire [10:0] write_ad, | ||
input wire [7:0] write_data, | ||
input wire [10:0] read_ad, | ||
output wire [7:0] read_data | ||
); | ||
|
||
wire gnd, vcc; | ||
assign gnd = 1'b0; | ||
assign vcc = 1'b1; | ||
|
||
wire [7:0] dummy; | ||
|
||
DPB mem( | ||
.DOB({dummy, read_data}), | ||
.DIA({{8{gnd}}, write_data}), | ||
.DIB({16{gnd}}), | ||
.ADA({write_ad, gnd, gnd, gnd}), | ||
.ADB({ read_ad, gnd, gnd, gnd}), | ||
.CLKA(write_clk), | ||
.CLKB(clk), | ||
.OCEA(vcc), | ||
.OCEB(vcc), | ||
.CEA(write_ce), | ||
.CEB(vcc), | ||
.WREA(vcc), | ||
.WREB(read_wre), | ||
.BLKSELA(3'b000), | ||
.BLKSELB(3'b000), | ||
.RESETA(write_reset), | ||
.RESETB(reset) | ||
); | ||
defparam mem.READ_MODE0 = 1'b1; | ||
defparam mem.READ_MODE1 = 1'b1; | ||
defparam mem.WRITE_MODE0 = 2'b01; | ||
defparam mem.WRITE_MODE1 = 2'b01; | ||
defparam mem.BIT_WIDTH_0 = 8; | ||
defparam mem.BIT_WIDTH_1 = 8; | ||
defparam mem.BLK_SEL_0 = 3'b000; | ||
defparam mem.BLK_SEL_1 = 3'b000; | ||
defparam mem.RESET_MODE = "SYNC"; | ||
`include "img-video-ram.vh" | ||
endmodule | ||
|
Oops, something went wrong.