- fixed cpu_rst
git-svn-id: http://moon:8086/svn/vhdl/trunk@1567 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
@@ -19,7 +19,7 @@ SRCS += ../src/tb_vga_ctrl.vhd
|
||||
# Compile
|
||||
TARGET := tb_vga_ctrl
|
||||
ENTITY := tb_vga_ctrl
|
||||
RUN_TIME := 2500us
|
||||
RUN_TIME := 250us
|
||||
|
||||
include $(VHDL_HOME)/make/ghdl.mk
|
||||
# -----------------------------------------------------------
|
||||
|
||||
@@ -68,7 +68,7 @@ ARCHITECTURE behavior OF tb_vga_ctrl IS
|
||||
END COMPONENT;
|
||||
|
||||
--Constants
|
||||
constant PERIOD : time := 9.9304865938430983118172790466733 ns;
|
||||
constant PERIOD : time := 10 ns;
|
||||
|
||||
--Inputs
|
||||
SIGNAL sys_rst_in : std_logic := '1';
|
||||
@@ -139,7 +139,7 @@ BEGIN
|
||||
BEGIN
|
||||
|
||||
-- Wait 100 ns for global reset to finish
|
||||
wait for 20*PERIOD;
|
||||
wait for 100*PERIOD;
|
||||
sys_rst_in <= '0';
|
||||
|
||||
wait for PERIOD;
|
||||
|
||||
@@ -61,15 +61,8 @@ architecture Behavioral of vga_ctrl_top is
|
||||
signal vga_clk : std_logic;
|
||||
|
||||
-- Timing
|
||||
signal scan_rdy_h : std_logic;
|
||||
signal scan_rdy_v : std_logic;
|
||||
signal vga_scan_x : std_logic;
|
||||
signal vga_scan_y : std_logic;
|
||||
|
||||
signal src_pos_x : natural range 0 to tsvga.ts_h.ncyc_scan-1;
|
||||
signal src_pos_y : natural range 0 to tsvga.ts_v.ncyc_scan-1;
|
||||
signal vga_pos_x : natural range 0 to tsvga.ts_h.ncyc_scan-1;
|
||||
signal vga_pos_y : natural range 0 to tsvga.ts_v.ncyc_scan-1;
|
||||
|
||||
-- Backend signals
|
||||
signal scan_rdy : std_logic;
|
||||
@@ -246,9 +239,10 @@ inst_vga_backend : entity work.vga_backend
|
||||
rst <= sys_rst_in;
|
||||
clk <= sys_clk_in;
|
||||
|
||||
scan_rdy <= scan_rdy_h and scan_rdy_v;
|
||||
scan_rdy <= stat_vga_rdy;
|
||||
|
||||
cg_en <= vga_scan_x and vga_scan_y;
|
||||
cg_en <= stat_scan;
|
||||
cg_draw <= stat_scan;
|
||||
cpu_ce <= '1';
|
||||
|
||||
---------------------------------------------------------------------------------------------
|
||||
@@ -343,12 +337,14 @@ cpu_reg_write:
|
||||
---------------------------------------------------------------------------------------------
|
||||
--- Test
|
||||
---------------------------------------------------------------------------------------------
|
||||
cpu_start: process (rst, vga_clk)
|
||||
cpu_start: process (clk)
|
||||
begin
|
||||
if (rst = '1') then
|
||||
cpu_rst <= '1';
|
||||
elsif rising_edge(vga_clk) and scan_rdy = '1' then
|
||||
cpu_rst <= '0';
|
||||
if rising_edge(vga_clk) then
|
||||
if rst = '1' then
|
||||
cpu_rst <= '1';
|
||||
else
|
||||
cpu_rst <= not scan_rdy;
|
||||
end if;
|
||||
end if;
|
||||
end process;
|
||||
|
||||
@@ -359,14 +355,14 @@ cpu_reg_write:
|
||||
end if;
|
||||
end process;
|
||||
|
||||
color_ctrl: process (rst, clk)
|
||||
color_ctrl: process (clk)
|
||||
variable enable : std_logic;
|
||||
begin
|
||||
if (rst = '1') then
|
||||
src_pos_x <= 0;
|
||||
src_pos_y <= 0;
|
||||
elsif rising_edge(clk) then
|
||||
if stat_scan = '1' then
|
||||
if rising_edge(clk) then
|
||||
if (rst = '1') then
|
||||
src_pos_x <= 0;
|
||||
src_pos_y <= 0;
|
||||
elsif stat_scan = '1' then
|
||||
if src_pos_x < tsvga.ts_h.ncyc_scan-1 then
|
||||
src_pos_x <= src_pos_x + 1;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user