From 09676ffb82d03aabe13473abad99b5c3b0d062fd Mon Sep 17 00:00:00 2001 From: Erick Date: Sun, 27 Mar 2022 19:00:14 +0200 Subject: [PATCH] minor fixes --- cpu/cpu.sv | 16 ++++++++++------ memory/ram/ram16384.sv | 4 ++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/cpu/cpu.sv b/cpu/cpu.sv index 0fa17f8..2a5beaa 100644 --- a/cpu/cpu.sv +++ b/cpu/cpu.sv @@ -4,27 +4,31 @@ import reg16::* 'include "gates/mux16.v" -package cpu ( +module cpu ( input [15:0]inM, input [15:0]instr, input reset, input clk, - input sel[15:0] output [15:0]outM, - output flagM[2:0] + output [2:0]flagM output wrtM, output [15:0]addrM, 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); -reg16 AReg(outInstrMux, wrtM, clk, addrM notOutAReg); +reg16 AReg(outInstrMux, wrtM, clk, addrM, notOutAReg); 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); pc pc(addrM, wrtM, reset, clk, pc); -endpackage \ No newline at end of file +endmodule \ No newline at end of file diff --git a/memory/ram/ram16384.sv b/memory/ram/ram16384.sv index 2c857c8..c0b9c48 100644 --- a/memory/ram/ram16384.sv +++ b/memory/ram/ram16384.sv @@ -1,6 +1,6 @@ import ram4096::*; -package ram16384 ( +module ram16384 ( input [16384:0]in; input [13:0]addr; input load; @@ -31,4 +31,4 @@ wire [4095:0] [8191:4095] out1 = out; wire [4095:0] [12287:8191] out2 = out; wire [4095:0] [16383:12287] out3 = out; -endpackage \ No newline at end of file +endmodule \ No newline at end of file