summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpu/cpu.ml24
-rw-r--r--cpu/example_cpu.ml2
-rw-r--r--monitor/disp.c8
-rwxr-xr-xmonitor/monbin17487 -> 17656 bytes
4 files changed, 17 insertions, 17 deletions
diff --git a/cpu/cpu.ml b/cpu/cpu.ml
index 23c0875..0cdc805 100644
--- a/cpu/cpu.ml
+++ b/cpu/cpu.ml
@@ -1,11 +1,11 @@
open Netlist_gen
open Alu
-let ser_out, set_ser_out = loop 8
-let ser_in_busy, set_ser_in_busy = loop 1
+let ser_out, save_ser_out = loop 8
+let ser_in_busy, save_ser_in_busy = loop 1
-let dbg_ra, set_dbg_ra = loop 16
-let dbg_read_data, set_dbg_read_data = loop 8
+let dbg_ra, save_dbg_ra = loop 16
+let dbg_read_data, save_dbg_read_data = loop 8
let cpu_ram ra we wa d =
(* Ram chip has word size = 8 bits and address size = 16 bits
@@ -34,31 +34,31 @@ let cpu_ram ra we wa d =
let read_data = mux read_ram read_data rd_ram in
let read_tick = eq_c 16 ra 0x4000 in
- let next_tick, set_next_tick = loop 8 in
+ let next_tick, save_next_tick = loop 8 in
let tick = nadder 8 (reg 8 next_tick) (get "tick" ++ zeroes 7) in
let read_data =
- set_next_tick (mux read_tick tick (zeroes 8)) ^.
+ save_next_tick (mux read_tick tick (zeroes 8)) ^.
mux read_tick read_data tick in
let write_ser = we ^& (eq_c 16 wa 0x4102) in
let read_data =
- set_ser_out (mux write_ser (zeroes 8) d) ^.
+ save_ser_out (mux write_ser (zeroes 8) d) ^.
read_data in
let read_ser = eq_c 16 ra 0x4100 in
- let next_ser, set_next_ser = loop 8 in
+ let next_ser, save_next_ser = loop 8 in
let ser = reg 8 next_ser in
let ser_in = get "ser_in" in
let iser = nonnull 8 ser_in in
let ser = mux iser ser ser_in in
let ser_busy = nonnull 8 ser in
let read_data =
- set_ser_in_busy ser_busy ^.
- set_next_ser (mux read_ser ser (zeroes 8)) ^.
+ save_ser_in_busy ser_busy ^.
+ save_next_ser (mux read_ser ser (zeroes 8)) ^.
mux read_ser read_data ser in
- set_dbg_ra ra ^.
- set_dbg_read_data read_data ^.
+ save_dbg_ra ra ^.
+ save_dbg_read_data read_data ^.
read_data
diff --git a/cpu/example_cpu.ml b/cpu/example_cpu.ml
index e626cae..17106b6 100644
--- a/cpu/example_cpu.ml
+++ b/cpu/example_cpu.ml
@@ -5,7 +5,7 @@ open Netlist_gen
let sumz n i =
let x, set_x = loop n in
let r = reg n x in
- let o1, o2 = Alu.nadder n i r (const "0") in
+ let o1, o2 = Alu.nadder_with_carry n i r (const "0") in
set_x o1, o2
let p =
diff --git a/monitor/disp.c b/monitor/disp.c
index 5a699de..7eaedc0 100644
--- a/monitor/disp.c
+++ b/monitor/disp.c
@@ -10,8 +10,6 @@
command line
*/
-#define STATUS_WIN_WIDTH 60
-
static void disp_cmdline();
static char command[100];
@@ -26,13 +24,15 @@ void disp_init() {
noecho();
nonl();
- wpstatus = newwin(LINES - 4, STATUS_WIN_WIDTH, 1, 1);
- wpoutput = newwin(LINES - 4, COLS - STATUS_WIN_WIDTH - 3, 1, STATUS_WIN_WIDTH + 2);
+ const int status_win_width = COLS / 2 + 5;
+ wpstatus = newwin(LINES - 4, status_win_width, 1, 1);
+ wpoutput = newwin(LINES - 4, COLS - status_win_width - 3, 1, status_win_width + 2);
wcmdline = newwin(1, COLS - 2, LINES - 2, 1);
intrflush(wcmdline, FALSE);
keypad(wcmdline, TRUE);
nodelay(wcmdline, TRUE);
+ scrollok(wpoutput, TRUE);
cmd_pos = 0;
command[0] = 0;
diff --git a/monitor/mon b/monitor/mon
index d74f52a..0c60bde 100755
--- a/monitor/mon
+++ b/monitor/mon
Binary files differ