diff options
| author | Julian Blake Kongslie | 2021-07-06 09:44:36 -0700 |
|---|---|---|
| committer | Julian Blake Kongslie | 2021-07-06 09:44:36 -0700 |
| commit | 60e1775b874015a3451e4bde10a8eb30701b1165 (patch) | |
| tree | 477a2835c0f7e616bdeeabe6aee85f8af8b79650 /sim/top.sv | |
| download | breadboarding-60e1775b874015a3451e4bde10a8eb30701b1165.tar.xz | |
Initial commit.
Diffstat (limited to 'sim/top.sv')
| -rw-r--r-- | sim/top.sv | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/sim/top.sv b/sim/top.sv new file mode 100644 index 0000000..6773739 --- /dev/null +++ b/sim/top.sv | |||
| @@ -0,0 +1,27 @@ | |||
| 1 | module top | ||
| 2 | #( parameter UIP_BITS = 15 | ||
| 3 | , parameter UROM_BITS = 8 | ||
| 4 | , parameter BUS_BITS = 16 | ||
| 5 | , parameter MEM_BITS = 8 | ||
| 6 | ) | ||
| 7 | ( input bit clk // verilator public | ||
| 8 | , input bit reset // verilator public | ||
| 9 | ); | ||
| 10 | |||
| 11 | bit [UIP_BITS-1:0] uip; | ||
| 12 | bit [BUS_BITS-1:0] abus; | ||
| 13 | bit [BUS_BITS-1:0] dbus; | ||
| 14 | |||
| 15 | alu #("../out/alu.bin", UIP_BITS, UROM_BITS, BUS_BITS) alu(clk, reset, uip, abus, dbus); | ||
| 16 | control #("../out/control.bin", UIP_BITS, UROM_BITS, BUS_BITS, "../out/consts.0.bin", "../out/consts.1.bin", 'h7ff8) control(clk, reset, uip, abus, dbus); | ||
| 17 | decode #("../out/decode.bin", UIP_BITS, UROM_BITS, BUS_BITS, 12) decode(clk, reset, uip, abus, dbus); | ||
| 18 | memory #("../out/memory.bin", UIP_BITS, UROM_BITS, BUS_BITS, "../out/image.hex", MEM_BITS) memory(clk, reset, uip, abus, dbus); | ||
| 19 | pc #("../out/pc.bin", UIP_BITS, UROM_BITS, BUS_BITS, 0) pc(clk, reset, uip, abus, dbus); | ||
| 20 | rf #("../out/rf.bin", UIP_BITS, UROM_BITS, BUS_BITS, 3) rf(clk, reset, uip, abus, dbus); | ||
| 21 | tmp #("../out/tmp0.bin", UIP_BITS, UROM_BITS, BUS_BITS) tmp0(clk, reset, uip, abus, dbus); | ||
| 22 | tmp #("../out/tmp1.bin", UIP_BITS, UROM_BITS, BUS_BITS) tmp1(clk, reset, uip, abus, dbus); | ||
| 23 | uart #("../out/uart.bin", UIP_BITS, UROM_BITS, BUS_BITS) uart(clk, reset, uip, abus, dbus); | ||
| 24 | |||
| 25 | //always @(negedge clk) $display("pc=%x uip=%x abus=%x dbus=%x tmp0=%x tmp1=%x alu=%x regs=%x:%x:%x:...:%x", pc.addr, uip, abus, dbus, tmp0.x, tmp1.x, alu.x, rf.storage[0], rf.storage[1], rf.storage[2], rf.storage[7]); | ||
| 26 | |||
| 27 | endmodule | ||
