-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
69 changed files
with
966 additions
and
55 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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,94 @@ | ||
|
||
`ifdef BSV_ASSIGNMENT_DELAY | ||
`else | ||
`define BSV_ASSIGNMENT_DELAY | ||
`endif | ||
|
||
// Dual-Ported BRAM (WRITE FIRST) | ||
module BRAM2(CLKA, | ||
ENA, | ||
WEA, | ||
ADDRA, | ||
DIA, | ||
DOA, | ||
CLKB, | ||
ENB, | ||
WEB, | ||
ADDRB, | ||
DIB, | ||
DOB | ||
); | ||
|
||
parameter PIPELINED = 0; | ||
parameter ADDR_WIDTH = 1; | ||
parameter DATA_WIDTH = 1; | ||
parameter MEMSIZE = 1; | ||
|
||
input CLKA; | ||
input ENA; | ||
input WEA; | ||
input [ADDR_WIDTH-1:0] ADDRA; | ||
input [DATA_WIDTH-1:0] DIA; | ||
output [DATA_WIDTH-1:0] DOA; | ||
|
||
input CLKB; | ||
input ENB; | ||
input WEB; | ||
input [ADDR_WIDTH-1:0] ADDRB; | ||
input [DATA_WIDTH-1:0] DIB; | ||
output [DATA_WIDTH-1:0] DOB; | ||
|
||
reg [DATA_WIDTH-1:0] RAM[0:MEMSIZE-1] /* synthesis syn_ramstyle="no_rw_check" */ ; | ||
reg [DATA_WIDTH-1:0] DOA_R; | ||
reg [DATA_WIDTH-1:0] DOB_R; | ||
reg [DATA_WIDTH-1:0] DOA_R2; | ||
reg [DATA_WIDTH-1:0] DOB_R2; | ||
|
||
`ifdef BSV_NO_INITIAL_BLOCKS | ||
`else | ||
// synopsys translate_off | ||
integer i; | ||
initial | ||
begin : init_block | ||
for (i = 0; i < MEMSIZE; i = i + 1) begin | ||
RAM[i] = { ((DATA_WIDTH+1)/2) { 2'b10 } }; | ||
end | ||
DOA_R = { ((DATA_WIDTH+1)/2) { 2'b10 } }; | ||
DOB_R = { ((DATA_WIDTH+1)/2) { 2'b10 } }; | ||
DOA_R2 = { ((DATA_WIDTH+1)/2) { 2'b10 } }; | ||
DOB_R2 = { ((DATA_WIDTH+1)/2) { 2'b10 } }; | ||
end | ||
// synopsys translate_on | ||
`endif // !`ifdef BSV_NO_INITIAL_BLOCKS | ||
|
||
always @(posedge CLKA) begin | ||
if (ENA) begin | ||
if (WEA) begin | ||
RAM[ADDRA] <= `BSV_ASSIGNMENT_DELAY DIA; | ||
DOA_R <= `BSV_ASSIGNMENT_DELAY DIA; | ||
end | ||
else begin | ||
DOA_R <= `BSV_ASSIGNMENT_DELAY RAM[ADDRA]; | ||
end | ||
end | ||
DOA_R2 <= `BSV_ASSIGNMENT_DELAY DOA_R; | ||
end | ||
|
||
always @(posedge CLKB) begin | ||
if (ENB) begin | ||
if (WEB) begin | ||
RAM[ADDRB] <= `BSV_ASSIGNMENT_DELAY DIB; | ||
DOB_R <= `BSV_ASSIGNMENT_DELAY DIB; | ||
end | ||
else begin | ||
DOB_R <= `BSV_ASSIGNMENT_DELAY RAM[ADDRB]; | ||
end | ||
end | ||
DOB_R2 <= `BSV_ASSIGNMENT_DELAY DOB_R; | ||
end | ||
|
||
// Output drivers | ||
assign DOA = (PIPELINED) ? DOA_R2 : DOA_R; | ||
assign DOB = (PIPELINED) ? DOB_R2 : DOB_R; | ||
|
||
endmodule // BRAM2 |
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,13 @@ | ||
|
||
module BypassWire(WGET, WVAL); | ||
|
||
|
||
parameter width = 1; | ||
|
||
input [width - 1 : 0] WVAL; | ||
|
||
output [width - 1 : 0] WGET; | ||
|
||
assign WGET = WVAL; | ||
|
||
endmodule |
Oops, something went wrong.