Vlsi Architecture Assignment-2 Name: Vithya M BITS ID: 2019HT01605
Vlsi Architecture Assignment-2 Name: Vithya M BITS ID: 2019HT01605
Name: Vithya M
Architecture Diagram
ID_EX_PipelineRegister ID_EX_PipelineRegister(.portC_RE_o(portC_RE_o),
.portC_RE_o1(portC_RE_o1), .readData1(readData1), .readData2(readData2), .writeReg(writeReg_1),
.opcode(opcode_1), .aluCtrl(aluCtrl), .aluInput1(aluInput1), .aluInput2(aluInput2),
.writeRegIDtoEX(writeRegIDtoEX));
EX_WB_PipelineRegister EX_WB_PipelineRegister(.aluOutput(aluOutput),
.portC_RE_o2(portC_RE_o2), .portC_RE_o3(portC_RE_o3), .writeRegIDtoEX(writeRegIDtoEX_1),
.writeReg(writeReg_2), .writeData(writeData_2));
Delay2 Delay2(.clk(clk), .portC_RE_o3(portC_RE_o3), .portC_RE_o4(portC_RE_o4),
.writeReg(writeReg_2), .writeData(writeData_2), .writeReg_3(writeReg_3), .writeData_3(writeData_3));
endmodule
initial begin
regFile[1] = 32'h40;
regFile[2] = 32'h60;
regFile[4] = 32'h60;
regFile[5] = 32'h40;
regFile[7] = 32'hFFFF856D;
regFile[8] = 32'hEEEE3721;
regFile[10] = 32'h1FFF756F;
regFile[11] = 32'hFFFF765E;
end
if (portA_RE == 1)
if (portB_RE == 1)
t_readData2 <= regFile[readReg2];
end
if (portC_RE == 1)
endmodule
output [31:0]PC;
output instMem_RE;
reg [31:0]temp;
reg t1;
if (reset == 1) begin
temp <= 0;
t1 <= 1'b1;
end
else begin
t1 <= 1'b1;
end
else
t1 <= 1'b0;
end
end
assign PC = temp;
endmodule
input instMem_RE;
input [31:0]PC;
initial begin
instMem[0] = 8'h41;
instMem[1] = 8'h8C;
instMem[2] = 8'h02;
instMem[3] = 8'h00;
instMem[4] = 8'hA4;
instMem[5] = 8'h18;
instMem[6] = 8'h03;
instMem[7] = 8'h00;
instMem[8] = 8'h07;
instMem[9] = 8'hA5;
instMem[10] = 8'h03;
instMem[11] = 8'h00;
instMem[12] = 8'h6A;
instMem[13] = 8'h35;
instMem[14] = 8'h02;
instMem[15] = 8'h00;
instMem[16] = 8'hff;
instMem[17] = 8'hff;
instMem[18] = 8'hff;
instMem[19] = 8'hff;
temp = 32'h00000000;
temp1 = 32'h00000000;
end
if (instMem_RE == 1)
end
endmodule
module IF_ID_PipelineRegister(instruction, instMem_RE, readReg1, readReg2, writeReg, opcode,
instMem_RE_o);
input [31:0]instruction;
input instMem_RE;
output [2:0]opcode;
output instMem_RE_o;
endmodule
input portC_RE_o;
output [4:0]writeRegIDtoEX;
output [2:0]aluCtrl;
output portC_RE_o1;
assign aluInput1 = readData1;
endmodule
output portC_RE_o3;
input portC_RE_o2;
endmodule
output portC_RE_o2;
input [4:0]writeRegIDtoEX;
reg temp2;
end
endmodule
input portC_RE_o3;
input clk;
output portC_RE_o4;
reg temp3;
end
assign writeReg_3 = temp1;
endmodule
Test Bench
module testBench();
initial begin
clk = 1;
reset = 1;
#10 reset = 0;
end
always
#5 clk = !clk;
endmodule
Result