From 2595dc1b6c0ac1d1694c94e165a0889c01c74b1a Mon Sep 17 00:00:00 2001 From: "(Tim) Efthimis Kritikos" Date: Fri, 10 Feb 2023 13:26:23 +0000 Subject: [PATCH] Hadn't added all files to previous commit --- cpu/Makefile | 17 +++++++++++++++-- cpu/memory.v | 2 +- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/cpu/Makefile b/cpu/Makefile index 63e786f..6a2f36f 100644 --- a/cpu/Makefile +++ b/cpu/Makefile @@ -14,9 +14,22 @@ wave: ${VVP} vvp ${VVP} -lxt2 gtkwave test.lx2 gtkwave_savefile.gtkw -${VVP} : ${SOURCES} ${INCLUDES} +${VVP} : ${SOURCES} ${INCLUDES} boot_code.txt iverilog -g2012 ${SOURCES} -o $@ .PHONY: clean clean: - rm -f ${VVP} test.lx2 + rm -f ${VVP} test.lx2 boot_code.txt boot_code.bin + +boot_code.txt:boot_code.bin + dd if=/dev/zero bs=1 count=256 of=boot_code.stage status=none + dd if=boot_code.bin of=boot_code.stage conv=notrunc,nocreat status=none + xxd -ps -c 2 boot_code.stage > boot_code.txt + rm boot_code.stage + +boot_code.bin:boot_code.asm + as86 -0 $< -b $@ + +.PHONY: dumpas +dumpas: boot_code.bin + objdump -D -b binary -m i8086 boot_code.bin diff --git a/cpu/memory.v b/cpu/memory.v index b33d009..2761a47 100644 --- a/cpu/memory.v +++ b/cpu/memory.v @@ -1,5 +1,5 @@ module rom(input [19:0] address,output wire [15:0] data ,input rd,input cs); -reg [15:0] memory [0:15]; +reg [15:0] memory [0:127]; initial begin $readmemh("boot_code.txt", memory); end