hdl: introduce adsb_fifo_t type to bladeRF-micro platform

adsb_fifo_t should be unified with rx_fifo_t when Quartus starts supporting
generic packages.
This commit is contained in:
Robert Ghilduta 2018-10-19 01:33:28 -04:00
commit cd83e18bac
3 changed files with 44 additions and 4 deletions

View file

@ -64,7 +64,7 @@ architecture hosted_bladerf of bladerf is
signal i2c_sda_oen : std_logic;
signal tx_sample_fifo : tx_fifo_t := TX_FIFO_T_DEFAULT;
signal rx_sample_fifo : rx_fifo_t := RX_FIFO_T_DEFAULT;
signal rx_sample_fifo : adsb_fifo_t := ADSB_FIFO_T_DEFAULT;
signal tx_loopback_fifo : loopback_fifo_t := LOOPBACK_FIFO_T_DEFAULT;
signal tx_meta_fifo : meta_fifo_tx_t := META_FIFO_TX_T_DEFAULT;

View file

@ -153,6 +153,10 @@ package bladerf_p is
constant RX_FIFO_RWIDTH : natural := 32; -- read side data width
constant RX_FIFO_LENGTH : natural := 4096; -- samples
constant ADSB_FIFO_WWIDTH : natural := 128; -- write side data width
constant ADSB_FIFO_RWIDTH : natural := 32; -- read side data width
constant ADSB_FIFO_LENGTH : natural := 1024; -- samples
constant LOOPBACK_FIFO_WWIDTH : natural := 64; -- write side data width
constant LOOPBACK_FIFO_RWIDTH : natural := 64; -- read side data width
constant LOOPBACK_FIFO_LENGTH : natural := 512; -- samples
@ -203,6 +207,25 @@ package bladerf_p is
RX_FIFO_RWIDTH, "OFF") downto 0);
end record;
type adsb_fifo_t is record
aclr : std_logic;
wclock : std_logic;
wdata : std_logic_vector(ADSB_FIFO_WWIDTH-1 downto 0);
wreq : std_logic;
wempty : std_logic;
wfull : std_logic;
wused : std_logic_vector(compute_wrusedw_high(ADSB_FIFO_LENGTH, "OFF") downto 0);
rclock : std_logic;
rdata : std_logic_vector(ADSB_FIFO_RWIDTH-1 downto 0);
rreq : std_logic;
rempty : std_logic;
rfull : std_logic;
rused : std_logic_vector(compute_rdusedw_high(ADSB_FIFO_LENGTH, ADSB_FIFO_WWIDTH,
ADSB_FIFO_RWIDTH, "OFF") downto 0);
end record;
type loopback_fifo_t is record
aclr : std_logic;
@ -393,6 +416,7 @@ package bladerf_p is
constant RFFE_GPI_DEFAULT : rffe_gpi_t;
constant TX_FIFO_T_DEFAULT : tx_fifo_t;
constant RX_FIFO_T_DEFAULT : rx_fifo_t;
constant ADSB_FIFO_T_DEFAULT : adsb_fifo_t;
constant LOOPBACK_FIFO_T_DEFAULT : loopback_fifo_t;
constant META_FIFO_TX_T_DEFAULT : meta_fifo_tx_t;
constant META_FIFO_RX_T_DEFAULT : meta_fifo_rx_t;
@ -725,6 +749,22 @@ package body bladerf_p is
rused => (others => '0')
);
constant ADSB_FIFO_T_DEFAULT : adsb_fifo_t := (
aclr => '1',
wclock => '0',
wdata => (others => '0'),
wreq => '0',
wempty => '1',
wfull => '0',
wused => (others => '0'),
rclock => '0',
rdata => (others => '0'),
rreq => '0',
rempty => '1',
rfull => '0',
rused => (others => '0')
);
constant LOOPBACK_FIFO_T_DEFAULT : loopback_fifo_t := (
aclr => '1',
wclock => '0',

View file

@ -52,10 +52,10 @@ entity rx is
sample_fifo_rclock : in std_logic;
sample_fifo_raclr : in std_logic;
sample_fifo_rreq : in std_logic;
sample_fifo_rdata : out std_logic_vector(RX_FIFO_T_DEFAULT.rdata'range);
sample_fifo_rdata : out std_logic_vector(ADSB_FIFO_T_DEFAULT.rdata'range);
sample_fifo_rempty : out std_logic;
sample_fifo_rfull : out std_logic;
sample_fifo_rused : out std_logic_vector(RX_FIFO_T_DEFAULT.rused'range);
sample_fifo_rused : out std_logic_vector(ADSB_FIFO_T_DEFAULT.rused'range);
-- Metadata to host via FX3
meta_fifo_rclock : in std_logic;
@ -94,7 +94,7 @@ architecture arch of rx is
signal rx_mux_mode : rx_mux_mode_t := RX_MUX_NORMAL;
signal sample_fifo : rx_fifo_t := RX_FIFO_T_DEFAULT;
signal sample_fifo : adsb_fifo_t := ADSB_FIFO_T_DEFAULT;
signal loopback_fifo : loopback_fifo_t := LOOPBACK_FIFO_T_DEFAULT;
signal meta_fifo : meta_fifo_rx_t := META_FIFO_RX_T_DEFAULT;