From fb8fdd41c7bb13fb8d0a7ffdb91926cd8cc45e55 Mon Sep 17 00:00:00 2001 From: J Date: Tue, 12 Mar 2019 22:42:41 -0400 Subject: [PATCH] move back to ghdl because nvc can't trace records yet, even though it simulates them --- ghdl_lattice.sh | 15 +++++++++++++++ ram.img | Bin 4672 -> 4672 bytes ram_init.vhd | 20 ++++++++++---------- register_file.vhd | 4 ++-- 4 files changed, 27 insertions(+), 12 deletions(-) create mode 100644 ghdl_lattice.sh diff --git a/ghdl_lattice.sh b/ghdl_lattice.sh new file mode 100644 index 0000000..179275d --- /dev/null +++ b/ghdl_lattice.sh @@ -0,0 +1,15 @@ +#!/bin/sh + +rm *.o *.cf + +ghdl -a cpu2j0_pkg.vhd components_pkg.vhd mult_pkg.vhd decode_pkg.vhd decode_body.vhd datapath_pkg.vhd cpu.vhd decode.vhd decode_core.vhd decode_table.vhd decode_table_reverse.vhd datapath.vhd register_file.vhd mult.vhd + +ghdl -a data_bus_pkg.vhd monitor_pkg.vhd ram_init.vhd lattice_ebr.vhd bus_monitor.vhd timeout_cnt.vhd cpu_simple_sram.vhd + +ghdl -a --work=sb_ice40_components_syn clk_sim.vhd + +ghdl -a cpu_lattice.vhd lattice_tb.vhd + +ghdl -e lattice_tb + +./lattice_tb --stop-time=2700ns --wave=out.ghw diff --git a/ram.img b/ram.img index f88d9ef70794be44f4a617f3a2cc762e4882c96f..04a11aed66a3d09a0467c86957a312fc3805e875 100755 GIT binary patch delta 60 zcmX@0azJGRkC2I>Rbrxvkx`nlNph-5GFMV*W=@KgLU3Y x"00000000" ); diff --git a/register_file.vhd b/register_file.vhd index c23bceb..cf54648 100644 --- a/register_file.vhd +++ b/register_file.vhd @@ -106,7 +106,7 @@ architecture two_bank of register_file is constant ZERO_ADDR : addr_t := (others => '0'); type ram_type is array(0 to NUM_REGS - 1) of data_t; - signal bank_a, bank_b : ram_type; + signal bank_a, bank_b : ram_type := (others => (others => '0')); signal reg0 : data_t; signal da : std_logic_vector(REG_WIDTH-1 downto 0); @@ -175,4 +175,4 @@ begin ex_pipes(1) <= ex_pipes(0); end if; end process; -end architecture; \ No newline at end of file +end architecture;