- changed frequencies into MHz units (real data type)
Committed on the Free edition of March Hare Software CVSNT Server. Upgrade to CVS Suite for more features and support: http://march-hare.com/cvsnt/ git-svn-id: http://moon:8086/svn/vhdl/trunk@734 cc03376c-175c-47c8-b038-4cd826a8556b
This commit is contained in:
+21
-21
@@ -1,5 +1,5 @@
|
||||
-----------------------------------------------------------------------
|
||||
-- $Header: /tmp/cvsroot/VHDL/lib/misc/async_port_wb.vhd,v 1.14 2010-02-07 15:42:47 Jens Exp $
|
||||
-- $Header: /tmp/cvsroot/VHDL/lib/misc/async_port_wb.vhd,v 1.15 2010-02-09 07:46:19 Jens Exp $
|
||||
-----------------------------------------------------------------------
|
||||
library IEEE;
|
||||
use IEEE.STD_LOGIC_1164.ALL;
|
||||
@@ -10,10 +10,10 @@ use work.async_types.all;
|
||||
entity async_port_wb is
|
||||
Generic
|
||||
(
|
||||
f_sysclk_hz : natural := 100E6;
|
||||
addr_width : natural := 32;
|
||||
data_width : natural := 32;
|
||||
byte_sel_width : natural := 4;
|
||||
f_sysclk : real := 100.0;
|
||||
addr_width : natural := 32;
|
||||
data_width : natural := 32;
|
||||
byte_sel_width : natural := 4;
|
||||
async_timespec : async_timespec_t
|
||||
);
|
||||
Port
|
||||
@@ -73,9 +73,9 @@ architecture Behavioral of async_port_wb is
|
||||
------------------------------------------------------------------
|
||||
begin
|
||||
|
||||
ASSERT to_cycles(async_timespec.T_pulse_rd, f_sysclk_hz) > 0 report "Read pulse length must be greater than zero!" severity failure;
|
||||
ASSERT to_cycles(async_timespec.T_pulse_wr, f_sysclk_hz) > 0 report "Write pulse length must be greater than zero!" severity failure;
|
||||
ASSERT (not async_timespec.can_page_rd OR (to_cycles(async_timespec.T_pulse_page_rd, f_sysclk_hz) > 1)) report "Read page pulse length must be greater than one!" severity failure;
|
||||
ASSERT to_cycles(async_timespec.T_pulse_rd, f_sysclk) > 0 report "Read pulse length must be greater than zero!" severity failure;
|
||||
ASSERT to_cycles(async_timespec.T_pulse_wr, f_sysclk) > 0 report "Write pulse length must be greater than zero!" severity failure;
|
||||
ASSERT (not async_timespec.can_page_rd OR (to_cycles(async_timespec.T_pulse_page_rd, f_sysclk) > 1)) report "Read page pulse length must be greater than one!" severity failure;
|
||||
|
||||
SRDY_O <= CYC_I and rdyo;
|
||||
en <= CYC_I and STB_I;
|
||||
@@ -111,7 +111,7 @@ architecture Behavioral of async_port_wb is
|
||||
process(s, cycle_cnt, en, WE_I, WE_I_r, do_page_read)
|
||||
begin
|
||||
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rst, f_sysclk_hz);
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rst, f_sysclk);
|
||||
cc_rst <= '0';
|
||||
as.rst <= '0';
|
||||
as.cs <= '0';
|
||||
@@ -139,17 +139,17 @@ architecture Behavioral of async_port_wb is
|
||||
if en = '1' then
|
||||
as.cs <= '1';
|
||||
cc_rst <= '1';
|
||||
if to_cycles(async_timespec.T_leadin, f_sysclk_hz) = 0 then
|
||||
if to_cycles(async_timespec.T_leadin, f_sysclk) = 0 then
|
||||
sn <= pulse;
|
||||
if WE_I = '1' then
|
||||
cycle_reload <= 0;
|
||||
sn <= leadin; -- always lead-in for writes
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rd, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rd, f_sysclk) - 1;
|
||||
as.rd <= '1';
|
||||
end if;
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_leadin, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_leadin, f_sysclk) - 1;
|
||||
sn <= leadin;
|
||||
end if;
|
||||
end if;
|
||||
@@ -163,9 +163,9 @@ architecture Behavioral of async_port_wb is
|
||||
cc_rst <= '1';
|
||||
sn <= pulse;
|
||||
if WE_I_r = '1' then
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_wr, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_wr, f_sysclk) - 1;
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rd, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_rd, f_sysclk) - 1;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
@@ -180,17 +180,17 @@ architecture Behavioral of async_port_wb is
|
||||
ack <= not WE_I_r;
|
||||
rdy <= do_page_read;
|
||||
if en = '1' and do_page_read = '1' then
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_page_rd, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_pulse_page_rd, f_sysclk) - 1;
|
||||
sn <= pulse;
|
||||
elsif to_cycles(async_timespec.T_leadout, f_sysclk_hz) = 0 then
|
||||
if to_cycles(async_timespec.T_release, f_sysclk_hz) = 0 then
|
||||
elsif to_cycles(async_timespec.T_leadout, f_sysclk) = 0 then
|
||||
if to_cycles(async_timespec.T_release, f_sysclk) = 0 then
|
||||
sn <= idle;
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_release, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_release, f_sysclk) - 1;
|
||||
sn <= release;
|
||||
end if;
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_leadout, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_leadout, f_sysclk) - 1;
|
||||
sn <= leadout;
|
||||
end if;
|
||||
end if;
|
||||
@@ -200,10 +200,10 @@ architecture Behavioral of async_port_wb is
|
||||
as.drive_d <= WE_I_r;
|
||||
if cycle_cnt = 0 then
|
||||
cc_rst <= '1';
|
||||
if to_cycles(async_timespec.T_release, f_sysclk_hz) = 0 then
|
||||
if to_cycles(async_timespec.T_release, f_sysclk) = 0 then
|
||||
sn <= idle;
|
||||
else
|
||||
cycle_reload <= to_cycles(async_timespec.T_release, f_sysclk_hz) - 1;
|
||||
cycle_reload <= to_cycles(async_timespec.T_release, f_sysclk) - 1;
|
||||
sn <= release;
|
||||
end if;
|
||||
end if;
|
||||
|
||||
Reference in New Issue
Block a user