Line 12... |
Line 12... |
`endif
|
`endif
|
|
|
);
|
);
|
|
|
|
|
|
|
input clk,reset;
|
input clk,reset;
|
input [`inputNumber-1:0] IN;
|
input [`inputNumber-1:0] IN;
|
output [`outputNumber-1:0] OUT;
|
output [`outputNumber-1:0] OUT;
|
|
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
Line 48... |
Line 47... |
|
|
wire branchOutc;
|
wire branchOutc;
|
wire [`accMuxSelLen-1:0] accMuxSelOutc;
|
wire [`accMuxSelLen-1:0] accMuxSelOutc;
|
wire accEnOutc;
|
wire accEnOutc;
|
wire [`op2MuxSelLen-1:0] op2MuxSelOutc;
|
wire [`op2MuxSelLen-1:0] op2MuxSelOutc;
|
|
wire aluEnc;
|
wire [`aluOpcodeLen-1:0] aluOpcodeOutc;
|
wire [`aluOpcodeLen-1:0] aluOpcodeOutc;
|
wire bitRamEnOutc, bitRamRwOutc, byteRamEnOutc, byteRamRwOutc;
|
wire bitRamEnOutc, bitRamRwOutc, byteRamEnOutc, byteRamRwOutc;
|
wire inputReadOutc, outputRwOutc;
|
wire inputReadOutc, outputRwOutc;
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
wire entypeEnOutc, tcAccReadOutc, tcResetEnOutc, tcPresetEnOutc, tcLoadEnOutc;
|
wire entypeEnOutc, tcAccReadOutc, tcResetEnOutc, tcPresetEnOutc, tcLoadEnOutc;
|
Line 65... |
Line 65... |
|
|
wire branchOut;
|
wire branchOut;
|
wire [`accMuxSelLen-1:0] accMuxSelOut;
|
wire [`accMuxSelLen-1:0] accMuxSelOut;
|
wire accEnOut;
|
wire accEnOut;
|
wire [`op2MuxSelLen-1:0] op2MuxSelOut;
|
wire [`op2MuxSelLen-1:0] op2MuxSelOut;
|
|
wire aluEn;
|
wire [`aluOpcodeLen-1:0] aluOpcodeOut;
|
wire [`aluOpcodeLen-1:0] aluOpcodeOut;
|
wire bitRamEnOut, bitRamRwOut, byteRamEnOut, byteRamRwOut;
|
wire bitRamEnOut, bitRamRwOut, byteRamEnOut, byteRamRwOut;
|
wire inputReadOut, outputRwOut;
|
wire inputReadOut, outputRwOut;
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
wire entypeEnOut, tcAccReadOut, tcResetEnOut, tcPresetEnOut, tcLoadEnOut;
|
wire entypeEnOut, tcAccReadOut, tcResetEnOut, tcPresetEnOut, tcLoadEnOut;
|
Line 138... |
Line 139... |
|
|
wire [`instOpCodeLen-1:0] instOpCode1;
|
wire [`instOpCodeLen-1:0] instOpCode1;
|
wire [`instFieldLen-1:0] instField1;
|
wire [`instFieldLen-1:0] instField1;
|
wire [`instFieldLen-1:0] instField2;
|
wire [`instFieldLen-1:0] instField2;
|
|
|
ppReg1 PipeLine_Reg1 (clk, instOpcode, instField, instOpcode1, instField1);
|
ppReg1 PipeLine_Reg1 (clk, instOpCode, instField, instOpCode1, instField1);
|
|
|
|
|
//-------- Control Unit Module Instance
|
//-------- Control Unit Module Instance
|
|
|
controlUnit CONTROL_UNIT (clk, reset, instOpCode1, accOut[0], instField2[8:7],
|
controlUnit CONTROL_UNIT (clk, reset, instOpCode1, accOut[0], instField2[8:7],
|
branchc,
|
branchOutc,
|
accMuxSelc, accEnc, op2MuxSelc, aluOpcodec,
|
accMuxSelOutc, accEnOutc, op2MuxSelOutc, aluEnc, aluOpcodeOutc, bitRamEnOutc,
|
bitRamEnc, bitRamRwc, byteRamEnc, byteRamRwc,
|
bitRamRwOutc, byteRamEnOutc, byteRamRwOutc, inputReadOutc, outputRwOutc
|
inputReadc, outputRwc
|
|
|
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
, entypeEnc, tcAccReadc, tcResetEnc, tcPresetEnc, tcLoadEnc
|
, entypeEnOutc, tcAccReadOutc, tcResetEnOutc, tcPresetEnOutc, tcLoadEnOutc
|
`endif
|
`endif
|
|
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
, uartReadc, uartWritec
|
, uartReadOutc, uartWriteOutcc
|
`endif
|
`endif
|
|
|
`ifdef SPI_peripheral
|
`ifdef SPI_peripheral
|
, sconEnc, spiStatReadc, spiBufReadc, spiBufWritec, spiBufShiftc
|
, sconEnOutc, spiStatReadOutc, spiBufReadOutc, spiBufWriteOutc, spiBufShiftOutc
|
`endif
|
`endif
|
|
|
);
|
);
|
|
|
|
|
Line 171... |
Line 168... |
|
|
|
|
|
|
ppReg2 PipeLine_Reg2 (clk,
|
ppReg2 PipeLine_Reg2 (clk,
|
branchOutc,
|
branchOutc,
|
accMuxSelOutc, accEnOutc, op2MuxSelOutc, aluOpcodeOutc, bitRamEnOutc,
|
accMuxSelOutc, accEnOutc, op2MuxSelOutc, aluEnc, aluOpcodeOutc, bitRamEnOutc,
|
bitRamRwOutc, byteRamEnOutc, byteRamRwOutc, inputReadOutc, outputRwOutc
|
bitRamRwOutc, byteRamEnOutc, byteRamRwOutc, inputReadOutc, outputRwOutc
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
, entypeEnOutc, tcAccReadOutc, tcResetEnOutc, tcPresetEnOutc, tcLoadEnOutc
|
, entypeEnOutc, tcAccReadOutc, tcResetEnOutc, tcPresetEnOutc, tcLoadEnOutc
|
`endif
|
`endif
|
`ifdef UART_peripheral
|
`ifdef UART_peripheral
|
Line 185... |
Line 182... |
, sconEnOutc, spiStatReadOutc, spiBufReadOutc, spiBufWriteOutc, spiBufShiftOutc
|
, sconEnOutc, spiStatReadOutc, spiBufReadOutc, spiBufWriteOutc, spiBufShiftOutc
|
`endif
|
`endif
|
, instField1
|
, instField1
|
|
|
, branchOut,
|
, branchOut,
|
accMuxSelOut, accEnOut, op2MuxSelOut, aluOpcodeOut,
|
accMuxSelOut, accEnOut, op2MuxSelOut, aluEn, aluOpcodeOut,
|
bitRamEnOut, bitRamRwOut, byteRamEnOut, byteRamRwOut,
|
bitRamEnOut, bitRamRwOut, byteRamEnOut, byteRamRwOut,
|
inputReadOut, outputRwOut
|
inputReadOut, outputRwOut
|
|
|
`ifdef timerAndCounter_peripheral
|
`ifdef timerAndCounter_peripheral
|
, entypeEnOut, tcAccReadOut, tcResetEnOut, tcPresetEnOut, tcLoadEnOut
|
, entypeEnOut, tcAccReadOut, tcResetEnOut, tcPresetEnOut, tcLoadEnOut
|
Line 233... |
Line 230... |
|
|
wire [7:0] op2Out;
|
wire [7:0] op2Out;
|
|
|
byteNegator byteNegatorForOp2Mux (op2MuxOut, instField2[9], op2Out);
|
byteNegator byteNegatorForOp2Mux (op2MuxOut, instField2[9], op2Out);
|
|
|
alu arithLogicUnit (aluOpcodeOut, accOut, op2Out, aluOut, carryOut);
|
alu arithLogicUnit (aluOpcodeOut, accOut, op2Out, aluEn, aluOut, carryOut);
|
|
|
wire bitIn;
|
wire bitIn;
|
|
|
bitNegator bitNegatorForBitRam (accOut[0], instField2[9], bitIn);
|
bitNegator bitNegatorForBitRam (accOut[0], instField2[9], bitIn);
|
|
|
Line 316... |
Line 313... |
//---------- SPI Modules
|
//---------- SPI Modules
|
// optional
|
// optional
|
|
|
`ifdef SPI_peripheral
|
`ifdef SPI_peripheral
|
|
|
spiStatReg SPI_STATUS_REG ();
|
|
|
|
spiConReg SPI_CONTROL_REG ();
|
|
|
|
spiBufReg SPI_BUFFER_REG ();
|
spi_top SPI_TOP (clk, sconEnOut, spiStatReadOut, instField2[7:0], spiStatOut, spiBufWriteOut, spiBufReadOut, aluOut, spiBufOut, MI, MO, SCK);
|
|
|
spiEngine SPI_MAIN ();
|
|
|
|
`endif
|
`endif
|
|
|
endmodule
|
endmodule
|
|
|
No newline at end of file
|
No newline at end of file
|