Fixed parameter ordering in instancing
This commit is contained in:
1 file changed
+5
-5
@@ -48,22 +48,22 @@ module assignment2 #(width=5, ramsz=9, romsz=10) (input logic [0:0] clk);
|
|||||||
logic [2**width-1:0] rd;
|
logic [2**width-1:0] rd;
|
||||||
logic [0:0] rd_we;
|
logic [0:0] rd_we;
|
||||||
|
|
||||||
instruction_counter PC #(width)(clk, pc_we, pc_addr_write, pc_addr);
|
instruction_counter #(width) PC (clk, pc_we, pc_addr_write, pc_addr);
|
||||||
rom ROM #(romsz, 2**width)(pc_addr, instruction);
|
rom #(romsz, 2**width) ROM (pc_addr, instruction);
|
||||||
instruction_classifier INSTRUCTION_CLASSIFIER(instruction[31:26], R, B1, J, B2, I, F, M);
|
instruction_classifier INSTRUCTION_CLASSIFIER(instruction[31:26], R, B1, J, B2, I, F, M);
|
||||||
instruction_module_classifier INSTRUCTION_MODULE_CLASSIFIER(instruction[5:3], en_shifter, en_jmp, en_mul, en_alu);
|
instruction_module_classifier INSTRUCTION_MODULE_CLASSIFIER(instruction[5:3], en_shifter, en_jmp, en_mul, en_alu);
|
||||||
|
|
||||||
register_file REGS #(width, 32)(clk,
|
register_file #(width, 5) REGS (clk,
|
||||||
rd_we, instruction[15:11],
|
rd_we, instruction[15:11],
|
||||||
rs, instruction[25:21],
|
rs, instruction[25:21],
|
||||||
rt, instruction[20:16]
|
rt, instruction[20:16]
|
||||||
);
|
);
|
||||||
|
|
||||||
logic [2**width-1:0] rd_alu;
|
logic [2**width-1:0] rd_alu;
|
||||||
alu ALU #(width)(instruction[3:0], rs, rt, rd_alu, flags[1:0]);
|
alu #(width) ALU (instruction[3:0], rs, rt, rd_alu, flags[1:0]);
|
||||||
|
|
||||||
logic [2**width-1:0] rd_shifter;
|
logic [2**width-1:0] rd_shifter;
|
||||||
shifter SHIFTER #(width)(instruction[2:0], rt, rs[4:0], instruction[10:6], rd_shifter);
|
shifter #(width) SHIFTER (instruction[2:0], rt, rs[4:0], instruction[10:6], rd_shifter);
|
||||||
|
|
||||||
rd = en_alu ? rd_alu : (en_shifter ? : rd_shifter : ({(2**width){1'b0}}));
|
rd = en_alu ? rd_alu : (en_shifter ? : rd_shifter : ({(2**width){1'b0}}));
|
||||||
endmodule
|
endmodule
|
||||||
|
|||||||
Reference in new issue
Block a user