Hola, estoy tratando de diseñar un multiprocesador en Verilog.
'timescale 1ns / 1ps
module Microprocessor(
input [7:0] instruction,
input clock,
input reset,
output [7:0] nextAddr,
output [6:0] seg1,
output [6:0] seg2
);
//wire [1:0] instructionTemp;
wire [7:0] nextAddrTemp;
reg [1:0] writeReg;
wire regDst;
//wire regData;
wire aluSrc;
//wire aluResult1;
wire memR;
wire memW;
wire [7:0] readData1;
wire [7:0] readData2;
reg [7:0] readData3;
wire [7:0] aluResult;
wire [7:0] readData;
reg [7:0] writeData;
wire regW;
wire [7:0] regData;
wire aluOp;
wire branch;
wire [1:0] instruction76;
wire [1:0] instruction54;
wire [1:0] instruction32;
wire [1:0] instruction10;
reg [1:0] dest;
wire m2r;
wire [7:0] instruction70;
assign instruction76 = instruction[7:6];
assign instruction54 = instruction[5:4];
assign instruction32 = instruction[3:2];
assign instruction70 = instruction[7:0];
assign instruction10 = instruction[1:0];
pc uut1(.clock(clock),.reset(reset),.isBranch(branch),.dest(dest),.count(nextAddr));
controlUnit uut2(.clock(clock),.inst(instruction76),.branch(branch),.m2r(m2r),.memR(memR),.memW(memW),.aluOp(aluOp),.regW(regW),.aluSrc(aluSrc),.regDst(regDst));
dataMemory uut3(.clock(clock),.reset(reset),.memR(memR),.memW(memW),.writeData(readData2),.address(aluResult),.readData(readData));
bcdDisplay uut4(.bcd(regData[7:4]),.seg(seg1));
bcdDisplay uut5(.bcd(regData[3:0]),.seg(seg2));
register uut6(.readReg1(instruction54),.readReg2(instruction32), .writeReg(writeReg), .writeData(writeData), .regWrite(regW),.clock(clock), .readData1(instruction54),.readData2(instruction32),.regData(regData));
ALU uut7(.ALUOp(aluOp),.clock(clock),.readData1(readData1),.readData2(readData3),.result(aluResult));
IMEM uut8(.Instruction(instruction70),.Read_Address(nextAddr));
always@(posedge clock)begin
case(instruction10)
2'b10:
dest <= -2;
2'b11:
dest <= -1;
default:
dest <= instruction10;
endcase
end
always@(posedge clock)begin
case(regDst)
1'b1:
writeReg <= instruction10;
1'b0:
writeReg <= instruction32;
endcase
end
always@(posedge clock)begin
case(aluSrc)
1'b1:
readData3 <= dest;
1'b0:
readData3 <= readData2;
endcase
end
always@(posedge clock)begin
case(m2r)
1'b1:
writeData <= readData;
1'b0:
writeData <= aluResult;
endcase
end
endmodule
Cuando ejecuto este código con los códigos de submódulos incluidos, aparece el siguiente error
ERROR:Xst:528 - Multi-source in Unit <Microprocessor> on signal <instruction<5>>; this signal is connected to multiple drivers.
Drivers are:
Primary input port <instruction<5>>
Signal <uut6/readData1<1>> in Unit <register> is assigned to GND
ERROR:Xst:528 - Multi-source in Unit <Microprocessor> on signal <instruction<4>>; this signal is connected to multiple drivers.
Drivers are:
Primary input port <instruction<4>>
Output port doB<0> of instance <uut6/Mram_register> of inferred macro RAM
ERROR:Xst:528 - Multi-source in Unit <Microprocessor> on signal <instruction<3>>; this signal is connected to multiple drivers.
Drivers are:
Primary input port <instruction<3>>
Signal <uut6/readData1<1>> in Unit <register> is assigned to GND
ERROR:Xst:528 - Multi-source in Unit <Microprocessor> on signal <instruction<2>>; this signal is connected to multiple drivers.
Drivers are:
Primary input port <instruction<2>>
Output port doB<0> of instance <uut6/Mram_register_ren> of inferred macro RAM
Noté que la mayoría de mis errores ocurren en el módulo de Registro, así que también subiré el módulo de registro.
'timescale 1ns / 1ps
module register(
input [1:0] readReg1,
input [1:0] readReg2,
input [1:0] writeReg,
input [7:0] writeData,
input regWrite,
input clock,
output [7:0] readData1,
output [7:0] readData2,
output reg[7:0] regData //goes to BCD!
);
reg [3:0] register[7:0];
wire readData1wire;
wire readData2wire;
assign readData1wire = register[readReg1];
assign readData2wire = register[readReg2];
always@(posedge clock)begin
if(regWrite==1)begin
register[writeReg] <= writeData;
end
regData <= writeData;
end
assign readData1 = readData1wire;
assign readData2 = readData2wire;
endmodule
Noté que ese tipo de error ocurre cuando intentas asignar valores a la misma variable varias veces en varios bucles always (). Sin embargo, no creo que no haya hecho eso en mi código. Se agradece cualquier tipo de ayuda. Gracias!