minor fixes
This commit is contained in:
+10
-6
@@ -4,27 +4,31 @@ import reg16::*
|
|||||||
|
|
||||||
'include "gates/mux16.v"
|
'include "gates/mux16.v"
|
||||||
|
|
||||||
package cpu (
|
module cpu (
|
||||||
input [15:0]inM,
|
input [15:0]inM,
|
||||||
input [15:0]instr,
|
input [15:0]instr,
|
||||||
input reset,
|
input reset,
|
||||||
input clk,
|
input clk,
|
||||||
input sel[15:0]
|
|
||||||
output [15:0]outM,
|
output [15:0]outM,
|
||||||
output flagM[2:0]
|
output [2:0]flagM
|
||||||
output wrtM,
|
output wrtM,
|
||||||
output [15:0]addrM,
|
output [15:0]addrM,
|
||||||
output [15:0]pc
|
output [15:0]pc
|
||||||
);
|
);
|
||||||
|
|
||||||
|
wire [11:6] [5:0] addrM = sel;
|
||||||
|
|
||||||
|
//FIXME: wrtM is not defined!
|
||||||
|
not (wrtM, notWrtM); //TODO: verify this
|
||||||
|
|
||||||
mux16 instrMux(outInstrMux, outM, instr, wrtM);
|
mux16 instrMux(outInstrMux, outM, instr, wrtM);
|
||||||
reg16 AReg(outInstrMux, wrtM, clk, addrM notOutAReg);
|
reg16 AReg(outInstrMux, wrtM, clk, addrM, notOutAReg);
|
||||||
|
|
||||||
mux16 inputMux(InAlu1, addrM, inM, wrtM);
|
mux16 inputMux(InAlu1, addrM, inM, wrtM);
|
||||||
reg16 DReg(outM, wrtM, clk, InAlu0, notOut);
|
reg16 DReg(outM, notWrtM, clk, InAlu0, notOut);
|
||||||
|
|
||||||
alu alu(InAlu0, InAlu1, sel, outM, flagM);
|
alu alu(InAlu0, InAlu1, sel, outM, flagM);
|
||||||
|
|
||||||
pc pc(addrM, wrtM, reset, clk, pc);
|
pc pc(addrM, wrtM, reset, clk, pc);
|
||||||
|
|
||||||
endpackage
|
endmodule
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
import ram4096::*;
|
import ram4096::*;
|
||||||
|
|
||||||
package ram16384 (
|
module ram16384 (
|
||||||
input [16384:0]in;
|
input [16384:0]in;
|
||||||
input [13:0]addr;
|
input [13:0]addr;
|
||||||
input load;
|
input load;
|
||||||
@@ -31,4 +31,4 @@ wire [4095:0] [8191:4095] out1 = out;
|
|||||||
wire [4095:0] [12287:8191] out2 = out;
|
wire [4095:0] [12287:8191] out2 = out;
|
||||||
wire [4095:0] [16383:12287] out3 = out;
|
wire [4095:0] [16383:12287] out3 = out;
|
||||||
|
|
||||||
endpackage
|
endmodule
|
||||||
Reference in New Issue
Block a user