Updated register file to use 2^n rather than n
This commit is contained in:
1 file changed
+5
-5
@@ -1,14 +1,14 @@
|
|||||||
`ifndef REGISTER_FILE_H
|
`ifndef REGISTER_FILE_H
|
||||||
`define REGISTER_FILE_H
|
`define REGISTER_FILE_H
|
||||||
|
|
||||||
module register_file #(parameter width=5, parameter nregs=32)(
|
module register_file #(parameter width=5, parameter nregs=5)(
|
||||||
input logic [0:0] clk, input logic[0:0] we,
|
input logic [0:0] clk, input logic[0:0] we,
|
||||||
input logic [$clog(nregs)-1:0] WA, input logic [2**width-1:0] WD,
|
input logic [nregs-1:0] WA, input logic [2**width-1:0] WD,
|
||||||
input logic [$clog(nregs)-1:0] RA1, output logic [2**width-1:0] RD1,
|
input logic [nregs-1:0] RA1, output logic [2**width-1:0] RD1,
|
||||||
input logic [$clog(nregs)-1:0] RA2, output logic [2**width-1:0] RD2
|
input logic [nregs-1:0] RA2, output logic [2**width-1:0] RD2
|
||||||
);
|
);
|
||||||
localparam BW = 2**width;
|
localparam BW = 2**width;
|
||||||
logic [2**width-1:0] regs[nregs];
|
logic [2**width-1:0] regs[2**nregs];
|
||||||
|
|
||||||
initial begin
|
initial begin
|
||||||
regs[0] = {(2**width){1'b0}};
|
regs[0] = {(2**width){1'b0}};
|
||||||
|
|||||||
Reference in new issue
Block a user