From 2de5c382a704aa5fd8e54a4b6385962a6c7d56cf Mon Sep 17 00:00:00 2001 From: David Banks Date: Tue, 9 Jun 2020 18:55:06 +0100 Subject: [PATCH] 6809: fix a bug with write watchpoints seeing data as 0xFF Change-Id: Id5ca15ad95a5f5bbee242368ca8bb9b2c0cf7364 --- src/MC6809CpuMon.vhd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/MC6809CpuMon.vhd b/src/MC6809CpuMon.vhd index 741c893..4bcfb90 100644 --- a/src/MC6809CpuMon.vhd +++ b/src/MC6809CpuMon.vhd @@ -101,6 +101,7 @@ architecture behavioral of MC6809CpuMon is signal Addr_int : std_logic_vector(15 downto 0); signal Din : std_logic_vector(7 downto 0); signal Dout : std_logic_vector(7 downto 0); + signal Dbusmon : std_logic_vector(7 downto 0); signal Sync_int : std_logic; signal hold : std_logic; @@ -176,7 +177,7 @@ begin cpu_clk => cpu_clk, cpu_clken => '1', Addr => Addr_int, - Data => Data, + Data => Dbusmon, Rd_n => not R_W_n_int, Wr_n => R_W_n_int, RdIO_n => '1', @@ -339,6 +340,13 @@ begin Dout when TSC = '0' and data_wr = '1' and R_W_n_int = '0' and memory_rd1 = '0' else (others => 'Z'); + -- Version of data seen by the Bus Mon need to use Din rather than the + -- external bus value as by the rising edge of cpu_clk we will have stopped driving + -- the external bus. On the ALS version we get away way this, but on the GODIL + -- version, due to the pullups, we don't. So all write watch breakpoints see + -- the data bus as 0xFF. + Dbusmon <= Din when R_W_n_int = '1' else Dout; + memory_done <= memory_rd1 or memory_wr1; -- Delayed/Deglitched version of the E clock