Skip to content

Commit

Permalink
flash align
Browse files Browse the repository at this point in the history
  • Loading branch information
vossstef committed Feb 7, 2025
1 parent a783fac commit 8149ddb
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 7 deletions.
5 changes: 4 additions & 1 deletion src/tang/nano20k_lcd/vic20nano_top_tn20k_lcd.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -367,6 +367,7 @@ signal pll_locked_d1 : std_logic;
signal pll_locked_hid : std_logic;
signal paddle_1_analogA: std_logic;
signal flash_ready : std_logic;
signal pll_locked_comb : std_logic;

constant TAP_ADDR : std_logic_vector(22 downto 0) := 23x"200000";

Expand Down Expand Up @@ -835,6 +836,8 @@ port map(
-- TP25k XTX XT25F64FWOIG
-- TM138k Winbond 25Q128BVEA

pll_locked_comb <= pll_locked_hid and flash_lock;

-- 100Mhz for flash controller c1541 ROM
flashclock: rPLL
generic map (
Expand Down Expand Up @@ -1080,7 +1083,7 @@ module_inst: entity work.sysctrl
flash_inst: entity work.flash
port map(
clk => flash_clk,
resetn => pll_locked,
resetn => pll_locked_comb,
ready => flash_ready,
busy => open,
address => (x"2" & "000" & dos_sel & c1541rom_addr),
Expand Down
10 changes: 7 additions & 3 deletions src/tang/primer20k/vic20nano_top_tp20k.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ signal paddle_1_analogA : std_logic;
signal paddle_1_analogB : std_logic;
signal paddle_2_analogA : std_logic;
signal paddle_2_analogB : std_logic;
signal flash_ready : std_logic;
signal pll_locked_comb : std_logic;

constant TAP_ADDR : std_logic_vector(22 downto 0) := 23x"200000";

Expand Down Expand Up @@ -627,7 +629,7 @@ variable pause_cnt : integer range 0 to 2147483647;
end if;
end process;

disk_reset <= '1' when disk_pause or c1541_osd_reset or c1541_reset or resetvic20 else '0';
disk_reset <= '1' when not flash_ready or disk_pause or c1541_osd_reset or c1541_reset or resetvic20 else '0';

-- rising edge sd_change triggers detection of new disk
process(clk32, pll_locked_hid)
Expand Down Expand Up @@ -1027,6 +1029,8 @@ port map(
-- phase shift 135° TN20k, TP25k
-- 270° TM 138k
-- 90° TP20k
pll_locked_comb <= pll_locked_hid and flash_lock;

-- 100Mhz for flash controller c1541 ROM
flashclock: rPLL
generic map (
Expand Down Expand Up @@ -1316,8 +1320,8 @@ module_inst: entity work.sysctrl
flash_inst: entity work.flash
port map(
clk => flash_clk,
resetn => pll_locked,
ready => open,
resetn => pll_locked_comb,
ready => flash_ready,
busy => open,
address => (x"2" & "000" & dos_sel & c1541rom_addr),
cs => c1541rom_cs,
Expand Down
7 changes: 5 additions & 2 deletions src/tang/primer20k_lcd/vic20nano_top_tp20k_lcd.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,8 @@ signal lcd_r_i : std_logic_vector(5 downto 0);
signal lcd_b_i : std_logic_vector(5 downto 0);
signal uart_ext_rx : std_logic := '1';
signal uart_ext_tx : std_logic;
signal flash_ready : std_logic;
signal flash_ready : std_logic;
signal pll_locked_comb : std_logic;

constant TAP_ADDR : std_logic_vector(22 downto 0) := 23x"200000";

Expand Down Expand Up @@ -956,6 +957,8 @@ port map(
-- phase shift 135° TN20k, TP25k
-- 270° TM 138k
-- 90° TP20k
pll_locked_comb <= pll_locked_hid and flash_lock;

-- 100Mhz for flash controller c1541 ROM
flashclock: rPLL
generic map (
Expand Down Expand Up @@ -1245,7 +1248,7 @@ module_inst: entity work.sysctrl
flash_inst: entity work.flash
port map(
clk => flash_clk,
resetn => pll_locked,
resetn => pll_locked_comb,
ready => flash_ready,
busy => open,
address => (x"2" & "000" & dos_sel & c1541rom_addr),
Expand Down
5 changes: 4 additions & 1 deletion src/vic20nano_top_tn20k.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ signal paddle_1_analogA: std_logic;
signal ds_cs_i : std_logic;
signal ds_miso_i : std_logic;
signal flash_ready : std_logic;
signal pll_locked_comb : std_logic;

constant TAP_ADDR : std_logic_vector(22 downto 0) := 23x"200000";

Expand Down Expand Up @@ -877,6 +878,8 @@ port map(
-- TP25k XTX XT25F64FWOIG
-- TM138k Winbond 25Q128BVEA

pll_locked_comb <= pll_locked_hid and flash_lock;

-- 100Mhz for flash controller c1541 ROM
flashclock: rPLL
generic map (
Expand Down Expand Up @@ -1122,7 +1125,7 @@ module_inst: entity work.sysctrl
flash_inst: entity work.flash
port map(
clk => flash_clk,
resetn => pll_locked,
resetn => pll_locked_comb,
ready => flash_ready,
busy => open,
address => (x"2" & "000" & dos_sel & c1541rom_addr),
Expand Down

0 comments on commit 8149ddb

Please sign in to comment.