Made sure CycleCount stopped when Z80 is paused

Change-Id: Ia5d4a7d216a089e06e1aaa86bcd43d512a429aaa
This commit is contained in:
David Banks
2015-06-28 22:17:32 +01:00
parent 0c0fde6a32
commit e66ecdfc3e
4 changed files with 9 additions and 1 deletions

View File

@@ -76,6 +76,7 @@ begin
Rdy => Rdy, Rdy => Rdy,
nRSTin => nRST, nRSTin => nRST,
nRSTout => nRST, nRSTout => nRST,
CountCycle => Rdy,
Regs => (others => '0'), Regs => (others => '0'),
RdOut => open, RdOut => open,
WrOut => open, WrOut => open,

View File

@@ -111,6 +111,7 @@ begin
Rdy => Rdy_int, Rdy => Rdy_int,
nRSTin => Res_n, nRSTin => Res_n,
nRSTout => Res_n, nRSTout => Res_n,
CountCycle => Rdy_int,
trig => trig, trig => trig,
lcd_rs => open, lcd_rs => open,
lcd_rw => open, lcd_rw => open,

View File

@@ -41,6 +41,8 @@ entity BusMonCore is
Rdy : out std_logic; Rdy : out std_logic;
nRSTin : in std_logic; nRSTin : in std_logic;
nRSTout : out std_logic; nRSTout : out std_logic;
CountCycle : in std_logic;
-- 6502 Registers -- 6502 Registers
-- unused in pure bus monitor mode -- unused in pure bus monitor mode
@@ -418,7 +420,7 @@ begin
-- Cycle counter, wraps every 16s at 1MHz -- Cycle counter, wraps every 16s at 1MHz
if (nRSTin = '0') then if (nRSTin = '0') then
cycleCount <= (others => '0'); cycleCount <= (others => '0');
elsif (Rdy_int = '1') then elsif (CountCycle = '1') then
cycleCount <= cycleCount + 1; cycleCount <= cycleCount + 1;
end if; end if;

View File

@@ -97,6 +97,7 @@ signal TState : std_logic_vector(2 downto 0);
signal SS_Single : std_logic; signal SS_Single : std_logic;
signal SS_Step : std_logic; signal SS_Step : std_logic;
signal SS_Step_held : std_logic; signal SS_Step_held : std_logic;
signal CountCycle : std_logic;
signal Regs : std_logic_vector(255 downto 0); signal Regs : std_logic_vector(255 downto 0);
signal memory_rd : std_logic; signal memory_rd : std_logic;
@@ -145,6 +146,7 @@ begin
Rdy => Rdy, Rdy => Rdy,
nRSTin => RESET_n_int, nRSTin => RESET_n_int,
nRSTout => nRST, nRSTout => nRST,
CountCycle => CountCycle,
trig => trig, trig => trig,
lcd_rs => open, lcd_rs => open,
lcd_rw => open, lcd_rw => open,
@@ -198,6 +200,8 @@ begin
WAIT_n_int <= WAIT_n when SS_Single = '0' else WAIT_n_int <= WAIT_n when SS_Single = '0' else
WAIT_n and SS_Step_held; WAIT_n and SS_Step_held;
CountCycle <= '1' when SS_Single = '0' or SS_Step_held = '1' else '0';
sync_gen : process(CLK_n, RESET_n_int) sync_gen : process(CLK_n, RESET_n_int)
begin begin