Compare commits

...
Sign in to create a new pull request.

27 commits

Author SHA1 Message Date
David Steele
5c3d713af8 HMBFDHV-1007. Fix bytes written being incorrect and add a trigger now option for software test 2024-03-18 14:34:17 +00:00
David Steele
2115d9b5e0 HMBFDHV-1007. Simulates now 2024-03-14 16:43:18 +00:00
David Steele
7f9708d22a Update to latest EL GIP 2024-03-14 14:32:14 +00:00
David Steele
6a02e8f52a HMBFDHV-1002. Add debug_wr_if so JB can get software building. (Debug_wr_if does not work in this version - everything else does) 2024-03-14 14:27:53 +00:00
David Steele
9306eb9492 HMBFDHV-1004. Fix timing 2024-03-14 10:39:34 +00:00
David Steele
2d5b5b53af HMBFDHV-1004. Make clear bits work per head 2024-03-14 09:09:09 +00:00
David Steele
e8aeee478e HMBFDHV-1004. Add counters to detect if printing non zero 2024-03-13 16:11:46 +00:00
David Steele
198801a123 HMBFDHV-1002. Change debug outputs to be useful. Also added hmb_fpga to test bench (no functional change) 2024-03-11 13:28:09 +00:00
David Steele
72f101ce49 HMBFDHV-985. Make shutdown signal turn off the head heaters 2024-02-29 16:59:04 +00:00
David Steele
7732464c0b Merge branch '0.9.8' of hydra.corp.globalinkjetsystems.com:GIS_Embedded_Logic/hmb-fd-sg1024 into 0.9.8 2024-02-28 17:08:44 +00:00
David Steele
5a90ab930d No Functional Change. Make comments clearer 2024-02-28 17:08:27 +00:00
David Steele
371b3e9b35 HMBFDHV-973. Add test to check Print Unit CSR registers read back correctly 2024-02-21 14:11:51 +00:00
David Steele
b6c81139a0 HMBFDHV-973. Make print unit registers read properly 2024-02-21 13:52:57 +00:00
David Steele
855dd6063a Fix hold timing 2024-01-31 15:23:39 +00:00
David Steele
defe456d26 Fix hold timing 2024-01-31 15:23:23 +00:00
David Steele
fcebf9e37e Try a different seed as 0.049 ns off timing 2024-01-31 14:45:24 +00:00
David Steele
26d5c96119 HMBFDHV-977. Add support for BA4 with inline merge disabled. Chip fits and tests pass 2024-01-31 12:02:02 +00:00
David Steele
4833f56398 HMBFDHV-977. All tests pass 2024-01-31 11:37:13 +00:00
David Steele
e526e62dc6 HMBFDHV-977. Fix multi_heads_test (allow print_data_width through to pixel buffer). Remove unused signals. Add Scratch debug reg 2024-01-31 11:27:54 +00:00
David Steele
cde8ca2d9d HMBFDHV-977. Data core and print streamer tests pass 2024-01-30 13:22:35 +00:00
David Steele
a1094be237 HMBFDHV-977. Update to latest EL GIP 2024-01-29 16:41:26 +00:00
David Steele
21e396ffb3 HMBFDHV-977. Compiles. Passes Avalon Bus test 2024-01-29 16:35:54 +00:00
David Steele
5583da6e21 HMBFDHV-977. Starting to compile 2024-01-26 16:45:47 +00:00
David Steele
c62ec3649a HMBFDHV-977. Update after mega merge 2024-01-26 13:39:10 +00:00
David Steele
45ab8e5cef HMBFDHV-973. Enable BA4 for 2G RAM 2024-01-18 13:38:53 +00:00
David Steele
920bb7a495 HMBFDHV-973. Update SG1024 0.9.6 to 2GB RAM ability 2024-01-02 13:43:34 +00:00
David Steele
99d36dcacb HMBFDHV-878 HMBFDHV-879 HMBFDHV-880. Add SOM I2C control and status. Swap incorrect SOM and APP labels in vhdl. Change HMB fpga to autogenerated registers
*** Note has to move the base address of the head monitors
So - Old H0 - 0x40, 0x50, 0x60, H3 - 0x70
     New H0 - 0x20, 0x40, 0x60, H3 - 0x80
2022-11-25 14:26:22 +00:00
75 changed files with 26916 additions and 20010 deletions

View file

@ -10,23 +10,23 @@ script {
// Main Software
if (isUnix()) {
env.ALTERA_REPO = "git@hydra:gis/altera_18_1_linux.git"
env.ALTERA_BRANCH = "origin/master"
env.ALTERA_BRANCH = "origin/master"
}
else {
env.ALTERA_REPO = "git@hydra:gis/altera_18_1.git"
env.ALTERA_BRANCH = "origin/master"
}
}
env.QSYS_PKG_VER = "18.1"
// Tools (tag on master)
env.FW_DEV_TOOL_BRANCH = "refs/tags/ELGIP_2021_06_24_A_DHLS"
// Generic IP
env.GENERIC_IP_BRANCH = "refs/tags/ELGIP_2021_08_25_A_DHLS"
env.FW_DEV_TOOL_BRANCH = "origin/master"
// Generic IP
env.GENERIC_IP_BRANCH = "origin/master"
// MinGW
env.MINGW_REPO = "git@hydra:GIS_Embedded_Logic/mingw.git"
env.MINGW_BRANCH = "origin/master"
// force extra rules for checking to permit critical warnings
env.USE_EXTRA_EXPRESSIONS="false"
// Shared Code
}

View file

@ -15,6 +15,7 @@
--! @b Interfaces:
--! @li Avalon MM master avm_rx_* : Avalon bus interface to memory system
--! @li pixel_buf_wr_* : Pixel buffer write port
--! @li en_dual_data_path : Enable inline merge dual path (if configured for dual path)
--! @li chan_en : print channel enable input
--! @li bpp_mode : bits per pixel mode input from CPU
--! @li print_data_width : Print data width (GMA9905300 is 18 bits wide. GMA3305300 is 6 bits wide)
@ -49,79 +50,115 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.common_pkg.all;
use work.pixel_buffer_2_pkg.all;
entity data_core is
generic(
MAX_BPP : integer := 3;
SHIFT_DEPTH : integer range 1 to 1024 := 128;
MAX_OP_WIDTH : natural range 1 to 48 := 48;
DELAY_WIDTH : integer := 10
MAX_BPP : integer := 3;
SHIFT_DEPTH : integer range 1 to 1024 := 128;
MAX_OP_WIDTH : natural range 1 to 48 := 48;
DELAY_WIDTH : integer := 10;
EN_PEEK : boolean := false;
NO_ZERO_GAP : boolean := false;
NUM_CHANS : integer range 1 to 4 := 2 -- number of PD inline-merge channels
);
port(
clk : in std_logic;
rst_n : in std_logic;
clk : in std_logic;
rst_n : in std_logic;
pixel_buf_wr : in std_logic;
pixel_buf_wr_data : in std_logic_vector(31 downto 0);
pixel_buf_rdy : out std_logic;
pixel_buf_wr : in std_logic;
pixel_buf_wr_data : in std_logic_vector(31 downto 0);
pixel_buf_rdy : out std_logic;
pixel_buf_last_word : in std_logic;
chan_en : in std_logic;
bpp_mode : in std_logic_vector(1 downto 0);
print_data_width : in std_logic_vector(5 downto 0);
clear_buffer : in std_logic;
fire_req : in std_logic;
sequencers_busy : out std_logic;
fp_holdoff_update : in std_logic;
wave_seq_len : in std_logic_vector(15 downto 0);
pixel_buf_wr_aux : in std_logic;
pixel_buf_wr_data_aux : in std_logic_vector(31 downto 0);
pixel_buf_rdy_aux : out std_logic;
pixel_buf_last_word_aux : in std_logic;
en_dual_data_path : in std_logic;
chan_en : in std_logic;
bpp_mode : in std_logic_vector( 1 downto 0);
print_data_width : in std_logic_vector( 5 downto 0);
clear_buffer : in std_logic;
fire_req : in std_logic;
fire_req_start_merge : in std_logic;
drop_stripe : in std_logic;
sequencers_busy : out std_logic;
px_buf_ch_nactive : out std_logic_vector(NUM_CHANS-1 downto 0);
fp_holdoff_update : in std_logic;
seq_data_config : in std_logic_vector(15 downto 0);
seq_gl_map : in std_logic_vector(7 downto 0);
seq_gl_map_update : in std_logic;
cpu_gl_map : in std_logic_vector(7 downto 0);
cpu_gl_map_en : in std_logic;
seq_gl_map : in std_logic_vector(7 downto 0);
seq_gl_map_update : in std_logic;
cpu_gl_map : in std_logic_vector(7 downto 0);
cpu_gl_map_en : in std_logic;
empty : out std_logic;
full : out std_logic;
overrun : out std_logic;
underrun : out std_logic;
dbl_drop : out std_logic;
fp_drop : out std_logic;
overlap_error : out std_logic;
empty : out std_logic;
full : out std_logic;
overrun : out std_logic;
underrun : out std_logic;
dbl_drop : out std_logic;
fp_drop : out std_logic;
seq_start_req : in std_logic;
seq_start_first_pulse : in std_logic;
seq_start_last_pulse : in std_logic;
seq_start_req : in std_logic;
seq_start_first_pulse : in std_logic;
seq_start_last_pulse : in std_logic;
seq_start_delay : in std_logic_vector(DELAY_WIDTH - 1 downto 0);
all_on : in std_logic;
print_data : out std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
print_clk : out std_logic_vector(0 downto 0);
print_data : out std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
print_clk : out std_logic_vector(0 downto 0);
diag_word_count : out std_logic_vector(6 downto 0)
);
diag_peek_sel : in std_logic;
diag_peek_addr : in std_logic_vector(31 downto 0);
diag_peek_data : out std_logic_vector(31 downto 0);
diag_peek_rdptr : out std_logic_vector( 7 downto 0);
diag_peek_wrptr : out std_logic_vector( 7 downto 0);
diag_peek_wdata : in std_logic_vector(31 downto 0);
diag_peek_wr : in std_logic;
diag_fire_req_count : out data_array_t(1 downto 0)(31 downto 0);
diag_fire_simg_count : out data_array_t(1 downto 0)(31 downto 0);
diag_last_stripe_count : out data_array_t(1 downto 0)(31 downto 0);
diag_word_count : out std_logic_vector( 6 downto 0)
);
end entity data_core;
architecture rtl of data_core is
signal reg_GL_map_int : std_logic_vector(7 downto 0);
signal pixel_buf_rd_data : std_logic_vector(MAX_OP_WIDTH * 33 - 1 downto 0);
signal pixel_buf_rd : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal gl_remap_in_data : std_logic_vector(MAX_BPP * MAX_OP_WIDTH - 1 downto 0);
signal gl_remap_valid : std_logic;
signal gl_remap_valid_int : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal gl_remap_ready : std_logic;
constant SHIFT_DEPTH_INCL_PAD : integer := ((SHIFT_DEPTH+31)/32)*32; -- Round up so even 1Bpp is an integer number of DWords
constant PIXEL_DEPTH : integer := 2**log2(4*4*SHIFT_DEPTH_INCL_PAD/32); -- 4 stripes @ 4Bpp rounded up to a power of 2
constant RSVD_DEPTH : integer := 2**log2(1*4*SHIFT_DEPTH_INCL_PAD/32)+1; -- Reserve at least a full stripe's worth of space.
-- Add one to stop sims complaining when pointer goes one off the end
signal seq_gl_map_int : std_logic_vector(7 downto 0);
signal seq_start_pulse_vec : std_logic_vector(1 downto 0);
signal pixel_buf_rd_data : std_logic_vector(MAX_OP_WIDTH * 32 - 1 downto 0);
signal pixel_buf_rd : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal pixel_buf_rd_valid : std_logic_vector(MAX_OP_WIDTH-1 downto 0);
signal bpp_mode_int : std_logic_vector(1 downto 0);
signal reg_GL_map_int : std_logic_vector(7 downto 0);
signal gl_remap_in_data : std_logic_vector(MAX_BPP * MAX_OP_WIDTH - 1 downto 0);
signal gl_remap_valid : std_logic;
signal gl_remap_valid_int : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal gl_remap_ready : std_logic;
signal chan_en_int : std_logic;
signal seq_gl_map_int : std_logic_vector(7 downto 0);
signal seq_start_pulse_vec : std_logic_vector(1 downto 0);
signal pixel_buf_wr_int : std_logic;
signal pixel_buf_wr_data_int : std_logic_vector(31 downto 0);
signal pixel_buf_rdy_int : std_logic;
signal bpp_mode_int : std_logic_vector(1 downto 0);
signal chan_en_int : std_logic;
signal pixel_buf_wr_int : std_logic_vector(1 downto 0);
signal pixel_buf_wr_data_int : data_array_t(1 downto 0)(31 downto 0);
signal pixel_buf_rdy_int : std_logic_vector(1 downto 0);
signal pixel_buf_last_word_int : std_logic_vector(1 downto 0);
signal diag_peek_data_int : std_logic_vector(31 downto 0);
begin
-------------------------------------------------
@ -131,85 +168,120 @@ begin
process(rst_n, clk) is
begin
if rst_n = '0' then
seq_gl_map_int <= (others => '0');
elsif clk'event and clk = '1' then
if seq_gl_map_update = '1' and seq_start_req = '1' then
seq_gl_map_int <= seq_gl_map;
end if;
end if;
if rst_n = '0' then
seq_gl_map_int <= (others => '0');
elsif clk'event and clk = '1' then
if seq_gl_map_update = '1' and seq_start_req = '1' then
seq_gl_map_int <= seq_gl_map;
end if;
end if;
end process;
-------------------------------------------------
-- The pixel buffer
-------------------------------------------------
preslicer_inst : entity work.preslicer_0
generic map(
NUM_STRIPES_DEPTH => 4,
NUM_STRIPES_FULL_MARGIN => 2,
SHIFT_DEPTH => SHIFT_DEPTH,
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map
preslicer_inst_dual : entity work.preslicer_dual
generic map (
NUM_STRIPES_DEPTH => 6,
NUM_STRIPES_FULL_MARGIN => 2,
SHIFT_DEPTH => SHIFT_DEPTH_INCL_PAD,
MAX_OP_WIDTH => MAX_OP_WIDTH,
NO_ZERO_GAP => NO_ZERO_GAP
)
port map
(
clk => clk,
rst_n => rst_n,
bpp_mode => bpp_mode,
clear_buffer => clear_buffer,
ps_buf_wr => pixel_buf_wr,
ps_buf_wr_data => pixel_buf_wr_data,
ps_buf_rdy => pixel_buf_rdy,
ps_buf_last_word => '0',
-- Output data
pixel_buf_wr => pixel_buf_wr_int,
pixel_buf_wr_data => pixel_buf_wr_data_int,
pixel_buf_rdy => pixel_buf_rdy_int,
pixel_buf_last_word => open,
ip_id_ip_number => open,
ip_id_mfr_number => open,
ip_ver_minor_number => open,
ip_ver_major_number => open
clk => clk,
rst_n => rst_n,
);
bpp_mode => bpp_mode,
pixel_buffer_inst : entity work.pixel_buffer_0
generic map(
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map
clear_buffer => clear_buffer,
ps_buf_wr => pixel_buf_wr,
ps_buf_wr_data => pixel_buf_wr_data,
ps_buf_rdy => pixel_buf_rdy,
ps_buf_last_word => pixel_buf_last_word,
ps_buf_wr_aux => pixel_buf_wr_aux,
ps_buf_wr_data_aux => pixel_buf_wr_data_aux,
ps_buf_rdy_aux => pixel_buf_rdy_aux,
ps_buf_last_word_aux => pixel_buf_last_word_aux,
-- Output data
pixel_buf_wr => pixel_buf_wr_int(0),
pixel_buf_wr_aux => pixel_buf_wr_int(1),
pixel_buf_wr_data => pixel_buf_wr_data_int(0),
pixel_buf_wr_data_aux => pixel_buf_wr_data_int(1),
pixel_buf_rdy => pixel_buf_rdy_int,
pixel_buf_last_word => pixel_buf_last_word_int
);
pixel_buffer_zg_inst : entity work.pixel_buffer_zero_gap_2
generic map (
MAX_OP_WIDTH => MAX_OP_WIDTH,
SHIFT_DEPTH => SHIFT_DEPTH_INCL_PAD,
PX_DEPTH => PIXEL_DEPTH,
RSVD_DEPTH => RSVD_DEPTH,
NUM_CHANS => NUM_CHANS,
NO_ZERO_GAP => NO_ZERO_GAP,
EN_PEEK => EN_PEEK
)
port map
(
clk => clk,
rst_n => rst_n,
pixel_buf_rdy => pixel_buf_rdy_int,
last_word => '0',
data => pixel_buf_wr_data_int,
wrreq => pixel_buf_wr_int,
rdreq => pixel_buf_rd(0),
q => pixel_buf_rd_data,
empty => empty,
full => full,
overrun => overrun,
underrun => underrun,
dbl_drop => dbl_drop,
fp_drop => fp_drop,
-- bpp_mode => 2x"3",
print_data_width => print_data_width,
clear_buffer => clear_buffer,
start_req => seq_start_req,
start_req_first => seq_start_first_pulse,
start_req_last => seq_start_last_pulse,
is_last_wave => open,
fire_req => fire_req,
sequencers_busy => sequencers_busy,
fp_holdoff_update => fp_holdoff_update,
wave_seq_len => wave_seq_len,
ip_id_ip_number => open,
ip_id_mfr_number => open,
ip_ver_minor_number => open,
ip_ver_major_number => open,
diag_word_count => diag_word_count
);
clk => clk,
rst_n => rst_n,
en_dual_data_path => en_dual_data_path,
print_data_width => print_data_width,
clear_buffer => clear_buffer,
start_req(0) => seq_start_req,
seq_1st_start_req => seq_start_req, -- Only used for SUB_HEADS
start_req_first => seq_start_first_pulse,
start_req_last => seq_start_last_pulse,
fire_req => fire_req,
fire_req_start_merge => fire_req_start_merge,
drop_stripe => drop_stripe,
sequencers_busy => sequencers_busy,
px_buf_ch_nactive => px_buf_ch_nactive,
fp_holdoff_update => fp_holdoff_update,
wave_seq_len => seq_data_config,
dbl_drop => dbl_drop,
fp_drop => fp_drop,
overlap_error => overlap_error,
last_word => pixel_buf_last_word_int,
data => pixel_buf_wr_data_int,
wrreq => pixel_buf_wr_int,
pixel_buf_rdy => pixel_buf_rdy_int,
rdreq => pixel_buf_rd(0),
rdreq_rdy => pixel_buf_rd_valid(0),
q => pixel_buf_rd_data,
empty => empty,
full => full,
underrun => underrun,
overrun => overrun,
all_on => all_on,
diag_peek_sel => diag_peek_sel,
diag_peek_addr => diag_peek_addr,
diag_peek_data => diag_peek_data_int,
diag_peek_rdptr => diag_peek_rdptr,
diag_peek_wrptr => diag_peek_wrptr,
diag_peek_wdata => diag_peek_wdata,
diag_peek_wr => diag_peek_wr,
diag_fire_req_count => diag_fire_req_count,
diag_fire_simg_count => diag_fire_simg_count,
diag_last_stripe_count => diag_last_stripe_count,
diag_word_count => diag_word_count
);
-------------------------------------------------
-- The set of slicers, connected to the read
@ -221,26 +293,26 @@ begin
GEN_SLICE : for i in 0 to MAX_OP_WIDTH - 1 generate
slicer_inst : entity work.slicer
generic map(
MAX_BPP => MAX_BPP,
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map(
clk => clk,
rst_n => rst_n,
slicer_inst : entity work.slicer
generic map(
MAX_BPP => MAX_BPP,
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map(
clk => clk,
rst_n => rst_n,
pixel_buf_rd => pixel_buf_rd(i),
pixel_buf_rd_data => pixel_buf_rd_data((i + 1) * 33 - 2 downto i * 33),
pixel_buf_rd => pixel_buf_rd(i),
pixel_buf_rd_data => pixel_buf_rd_data((i + 1) * 32 - 1 downto i * 32),
bpp_mode => 2x"3",
chan_en => chan_en_int,
start_req => seq_start_req,
bpp_mode => 2x"3",
chan_en => chan_en_int,
start_req => seq_start_req,
gl_remap_in_data => gl_remap_in_data(i * 3 + 2 downto i * 3),
gl_remap_valid => gl_remap_valid_int(i),
gl_remap_ready => gl_remap_ready
);
gl_remap_in_data => gl_remap_in_data(i * 3 + 2 downto i * 3),
gl_remap_valid => gl_remap_valid_int(i),
gl_remap_ready => gl_remap_ready
);
end generate GEN_SLICE;
@ -255,22 +327,22 @@ begin
reg_GL_map_int <= cpu_gl_map when cpu_gl_map_en = '1' else seq_gl_map_int;
gl_remap_inst : entity work.gl_remap
generic map(
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map(
clk => clk,
rst_n => rst_n,
generic map(
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map(
clk => clk,
rst_n => rst_n,
reg_GL_map => reg_GL_map_int,
reg_GL_map => reg_GL_map_int,
in_valid => gl_remap_valid,
in_data => gl_remap_in_data,
in_ready => gl_remap_ready,
in_valid => gl_remap_valid,
in_data => gl_remap_in_data,
in_ready => gl_remap_ready,
out_data_head => print_data,
out_clk_head => print_clk
);
out_data_head => print_data,
out_clk_head => print_clk
);
end rtl;
end rtl;

View file

@ -0,0 +1,236 @@
-----------------------------------------------------------------------------
--! @file
--! @brief SOM FPGA preslicer
--!
--! @details This block is the the data core preslicer. Its purpose is to convert
--! variable BPP data into a fixed width stream before sending towards the pixel
--! buffer. It uses a FIFo to buffer print streamer data, flagging when to halt
--! data at half full, to allow for any inflight memory requests. This replaces
--! most of the functionality of the slicers (post pixel buffer), which are fixed
--! at 3/4 BPP. See
--! https://confluence.gisapps.co.uk/pages/viewpage.action?spaceKey=GMAHMB&title=HMB-FD-GMA+Design+Documentation
--!
--! @b Clock/resets:
--! @li clk : nominally 100MHz
--! @li rst_n : active low reset for clk (asynchronous assert)
--!
--! @b Interfaces:
--! @li bpp_mode : the current bits-per-pixel mode (1, 2 or 3---same as 4BPP)
--! @li clear_buffer : Pixel buffer clear pulse input
--! @li ps_buf_wr_data : print streamer data input
--! @li ps_buf_wr : Write strobe input for print streamer data
--! @li ps_buf_rdy : Ready output towards print streamer
--! @li ps_buf_last_word : input to flag last word of a image's stripes
--! @li pixel_buf_wr_data : pixel buffer data data output
--! @li pixel_buf_wr : Write strobe output to pixel buffer
--! @li pixel_buf_rdy : Ready input from pixel buffer
--! @li pixel_buf_last_word : Output flagging last word of an image's stripes
--! @li ip_id_ip_number : Module's ID number
--! @li ip_id_mfr_number : Module's manufacture number
--! @li ip_ver_minor_number : Module's Minor version number
--! @li ip_ver_major_number : Module's Major version number
--!
--! @b Clock-crossing considerations:
--! @li Module is a single clock domain synchronous block
--!
--! @b Language build standard requirements:
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2019 Global Inkjet Systems
--! @date 2019-05-02
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
entity preslicer is
generic(
NUM_STRIPES_DEPTH : integer range 2 to 32 := 8; -- whole 1bpp equivalent stripes must it be possible to buffer in preslicer
NUM_STRIPES_FULL_MARGIN : integer range 1 to 31 := 2; -- at least this many 1bpp equivalent stripes space must be available
SHIFT_DEPTH : integer range 1 to 2048 := 128; -- head shift buffer depth
MAX_OP_WIDTH : natural range 1 to 128 := 8;
DEVICE_FAMILY : string := "Cyclone V" -- "Cyclone 10 LP"
);
port
(
clk : in std_logic;
rst_n : in std_logic;
bpp_mode : in std_logic_vector(1 downto 0);
clear_buffer : in std_logic;
-- Interface to print streamer
ps_buf_wr : in std_logic;
ps_buf_wr_data : in std_logic_vector(31 downto 0);
ps_buf_rdy : out std_logic;
ps_buf_last_word : in std_logic;
-- Output data
pixel_buf_wr : out std_logic;
pixel_buf_wr_data : out std_logic_vector(31 downto 0);
pixel_buf_rdy : in std_logic;
pixel_buf_last_word : out std_logic;
ip_id_ip_number : out std_logic_vector(7 downto 0) := 8x"1d";
ip_id_mfr_number : out std_logic_vector(7 downto 0) := 8x"00";
ip_ver_minor_number : out std_logic_vector(7 downto 0) := 8x"03";
ip_ver_major_number : out std_logic_vector(7 downto 0) := 8x"00"
);
end preslicer;
architecture rtl of preslicer is
type ps_array_t is array (natural range <>) of std_logic_vector;
constant DWORD_BITS : integer := 32;
constant STRIPE_SIZE : integer := ((SHIFT_DEPTH * MAX_OP_WIDTH) / DWORD_BITS);
constant DEPTH : natural range 1 to 8182 := STRIPE_SIZE * NUM_STRIPES_DEPTH; -- in 32bit words (+ 1 bit flag)
constant ALMOST_FULL_THRESH : natural range 1 to 2048 := STRIPE_SIZE * (NUM_STRIPES_DEPTH - NUM_STRIPES_FULL_MARGIN);
signal rdreq : std_logic;
signal word_num : ps_array_t(0 to 0)(1 downto 0);
signal empty : std_logic;
signal almost_full : std_logic;
signal q : std_logic_vector(32 downto 0);
signal bpp1_slice : ps_array_t(0 to 3)(32 downto 0);
signal bpp2_slice : ps_array_t(0 to 1)(32 downto 0);
signal bpp3_slice : ps_array_t(0 to 0)(32 downto 0);
signal read_phase : std_logic;
signal pixel_buf_wr_data_int : std_logic_vector(32 downto 0);
signal ps_buf_wr_data_int : std_logic_vector(32 downto 0);
signal ps_buf_wr_int : std_logic;
signal pixel_buf_rdy_int : std_logic;
begin
-- pragma translate_off
assert NUM_STRIPES_DEPTH > NUM_STRIPES_FULL_MARGIN report "NUM_STRIPES_FULL_MARGIN must be < NUM_STRIPES_DEPTH" severity failure;
-- pragma translate_on
ps_buf_wr_data_int <= ps_buf_last_word & ps_buf_wr_data;
ps_buf_wr_int <= ps_buf_wr;
pixel_buf_rdy_int <= pixel_buf_rdy;
-- Pull out the bits from the shift register for the 3 BPP mode
bpp3_slice(0) <= q;
-- @formatter:off
-- Pull out the bits from the shift register for the 2BPP mode
bpp2_slice(1) <= q(32) &
"00" & q(31 downto 30) & "00" & q(29 downto 28) &
"00" & q(27 downto 26) & "00" & q(25 downto 24) &
"00" & q(23 downto 22) & "00" & q(21 downto 20) &
"00" & q(19 downto 18) & "00" & q(17 downto 16);
bpp2_slice(0) <= "000" & q(15 downto 14) & "00" & q(13 downto 12) &
"00" & q(11 downto 10) & "00" & q( 9 downto 8) &
"00" & q( 7 downto 6) & "00" & q( 5 downto 4) &
"00" & q( 3 downto 2) & "00" & q( 1 downto 0);
-- Pull out the bits from the shift register for the 3BPP mode
bpp1_slice(3) <= q(32) &
"000" & q(31) & "000" & q(30) & "000" & q(29) & "000" & q(28) &
"000" & q(27) & "000" & q(26) & "000" & q(25) & "000" & q(24);
bpp1_slice(2) <= "0000" & q(23) & "000" & q(22) & "000" & q(21) & "000" & q(20) &
"000" & q(19) & "000" & q(18) & "000" & q(17) & "000" & q(16);
bpp1_slice(1) <= "0000" & q(15) & "000" & q(14) & "000" & q(13) & "000" & q(12) &
"000" & q(11) & "000" & q(10) & "000" & q( 9) & "000" & q( 8);
bpp1_slice(0) <= "0000" & q( 7) & "000" & q( 6) & "000" & q( 5) & "000" & q( 4) &
"000" & q( 3) & "000" & q( 2) & "000" & q( 1) & "000" & q( 0);
-- Indicate the word_num phases to read the fifo for each BPP mode
read_phase <= '1' when (bpp_mode = 2x"1" and word_num(0) = 2x"3") or
(bpp_mode = 2x"2" and word_num(0)(0) = '1') or
bpp_mode = 2x"3" or bpp_mode = 2x"0" else '0';
-- @formatter:on
pixel_buf_wr_data <= pixel_buf_wr_data_int(31 downto 0);
pixel_buf_last_word <= pixel_buf_wr_data_int(32);
-- Instantiate The FIFO.
preslicer_fifo_inst : entity work.alt_sync_fifo
generic map
(
DATA_WIDTH => 33,
DEPTH => DEPTH,
REGISTER_OUTPUT => "ON",
NEARLY_FULL => ALMOST_FULL_THRESH,
DEVICE_FAMILY => DEVICE_FAMILY,
SHOWAHEAD => "ON",
CHECKING => "ON"
)
port map
(
clk => clk,
sclr => clear_buffer,
wrdata => ps_buf_wr_data_int,
wrreq => ps_buf_wr_int,
almost_full => almost_full,
empty => empty,
rdreq => rdreq,
rddata => q
);
-- Flag to print streamer we're ready for data until almost full
ps_buf_rdy <= not almost_full;
rdreq <= pixel_buf_rdy_int and not empty and read_phase;
PRESLICER_CTRL : process(rst_n, clk) is
begin
if rst_n = '0' then
pixel_buf_wr <= '0';
word_num(0) <= (others => '0');
elsif clk'event and clk = '1' then
-- Select, for the data output from the expanded slice, using the matching pipelined word_num value.
if bpp_mode = 2x"1" then
pixel_buf_wr_data_int <= bpp1_slice(to_integer(unsigned(word_num(0))));
elsif bpp_mode = 2x"2" then
pixel_buf_wr_data_int <= bpp2_slice(to_integer(unsigned(word_num(0)(0 downto 0))));
else
pixel_buf_wr_data_int <= bpp3_slice(0);
end if;
-- Start writing to the pixel buffer when word_num reaches 2. Clear if pixel buffer is stalled
-- (aligned with output stage).
pixel_buf_wr <= not empty and pixel_buf_rdy_int;
-- Read from the FIFO if the pixel buffer is ready, and okay to read, but continue
-- if in the middle of a transfer. Similarly, increment the word_num index.
if pixel_buf_rdy_int = '1' and empty = '0' then
word_num(0) <= std_logic_vector(unsigned(word_num(0)) + 1);
end if;
if clear_buffer then
pixel_buf_wr <= '0';
word_num(0) <= (others => '0');
end if;
end if;
end process;
end rtl;

View file

@ -0,0 +1,169 @@
-------------------------------------------------------------------------------
--! @file
--! @brief SOM FPGA preslicer
--!
--! @details This block is the data core dual channel preslicer wrapper.
--!
--! @b Clock/resets:
--! @li clk : nominally 100MHz
--! @li rst_n : active low reset for clk (asynchronous assert)
--!
--! @b Interfaces:
--! @li bpp_mode : the current bits-per-pixel mode (1, 2 or 3---same as 4BPP)
--! @li clear_buffer : Pixel buffer clear pulse input
--! @li ps_buf_wr_data* : print streamer data input
--! @li ps_buf_wr* : Write strobe input for print streamer data
--! @li ps_buf_rdy* : Ready output towards print streamer
--! @li ps_buf_last_word* : input to flag last word of a image's stripes
--! @li pixel_buf_wr_data* : pixel buffer data data output
--! @li pixel_buf_wr* : Write strobe output to pixel buffer
--! @li pixel_buf_rdy : Ready input from pixel buffer
--! @li pixel_buf_last_word : Output flagging last word of an image's stripes
--!
--! @b Clock-crossing considerations:
--! @li Module is a single clock domain synchronous block
--!
--! @b Language build standard requirements:
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2020 Global Inkjet Systems
--! @date 2020-04-02
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity preslicer_dual is
generic (
NUM_STRIPES_DEPTH : integer range 2 to 32 := 8; -- whole 1bpp equivalent stripes must it be possible to buffer in preslicer
NUM_STRIPES_FULL_MARGIN : integer range 1 to 31 := 2; -- at least this many 1bpp equivalent stripes space must be available
SHIFT_DEPTH : integer range 1 to 2048 := 128; -- head shift buffer depth
MAX_OP_WIDTH : natural range 1 to 128 := 8;
NO_ZERO_GAP : boolean := false
);
port
(
clk : in std_logic;
rst_n : in std_logic;
bpp_mode : in std_logic_vector( 1 downto 0);
clear_buffer : in std_logic;
-- Interface to print streamer
ps_buf_wr : in std_logic;
ps_buf_wr_data : in std_logic_vector(31 downto 0);
ps_buf_rdy : out std_logic;
ps_buf_last_word : in std_logic;
-- Auxiliary print streamer interafce. Used only if mutually
-- exclusive from main interafce (shared memory port)
ps_buf_wr_aux : in std_logic;
ps_buf_wr_data_aux : in std_logic_vector(31 downto 0);
ps_buf_rdy_aux : out std_logic;
ps_buf_last_word_aux : in std_logic;
-- Output data
pixel_buf_wr_aux : out std_logic;
pixel_buf_wr : out std_logic;
pixel_buf_wr_data : out std_logic_vector(31 downto 0);
pixel_buf_wr_data_aux : out std_logic_vector(31 downto 0);
pixel_buf_rdy : in std_logic_vector( 1 downto 0);
pixel_buf_last_word : out std_logic_vector( 1 downto 0)
);
end preslicer_dual;
architecture rtl of preslicer_dual is
type data_array_t is array (0 to 1) of std_logic_vector(31 downto 0);
signal ps_buf_wr_int : std_logic_vector(1 downto 0);
signal ps_buf_wr_data_int : data_array_t;
signal ps_buf_rdy_int : std_logic_vector(1 downto 0);
signal ps_buf_last_word_int : std_logic_vector(1 downto 0);
signal pixel_buf_wr_int : std_logic_vector(1 downto 0);
signal pixel_buf_wr_data_int : data_array_t;
signal pixel_buf_rdy_int : std_logic_vector(1 downto 0);
signal pixel_buf_last_word_int : std_logic_vector(1 downto 0);
begin
ps_buf_wr_int(0) <= ps_buf_wr;
ps_buf_wr_data_int(0) <= ps_buf_wr_data;
ps_buf_rdy <= ps_buf_rdy_int(0);
ps_buf_last_word_int(0) <= ps_buf_last_word;
pixel_buf_wr <= pixel_buf_wr_int(0);
pixel_buf_wr_data <= pixel_buf_wr_data_int(0);
pixel_buf_rdy_int(0) <= pixel_buf_rdy(0);
pixel_buf_last_word(0) <= pixel_buf_last_word_int(0);
GEN_ZG: if NO_ZERO_GAP = false generate
ps_buf_wr_int(1) <= ps_buf_wr_aux;
ps_buf_wr_data_int(1) <= ps_buf_wr_data_aux;
ps_buf_last_word_int(1) <= ps_buf_last_word_aux;
ps_buf_rdy_aux <= ps_buf_rdy_int(1);
pixel_buf_wr_aux <= pixel_buf_wr_int(1);
pixel_buf_wr_data_aux <= pixel_buf_wr_data_int(1);
pixel_buf_rdy_int(1) <= pixel_buf_rdy(1);
pixel_buf_last_word(1) <= pixel_buf_last_word_int(1);
end generate;
GEN_NO_ZG_TIE_OFF : if NO_ZERO_GAP generate
ps_buf_wr_int(1) <= '0';
ps_buf_wr_data_int(1) <= (others => '0');
ps_buf_last_word_int(1) <= '0';
ps_buf_rdy_aux <= '0';
pixel_buf_wr_aux <= '0';
pixel_buf_wr_data_aux <= (others => '0');
pixel_buf_rdy_int(1) <= '0';
pixel_buf_last_word(1) <= '0';
end generate;
GEN_PRESLICER : for i in 0 to 1 generate
GEN_NO_ZG : if i = 0 or NO_ZERO_GAP = false generate
preslicer_inst : entity work.preslicer
generic map (
NUM_STRIPES_DEPTH => NUM_STRIPES_DEPTH,
NUM_STRIPES_FULL_MARGIN => NUM_STRIPES_FULL_MARGIN,
SHIFT_DEPTH => SHIFT_DEPTH,
MAX_OP_WIDTH => MAX_OP_WIDTH
)
port map
(
clk => clk,
rst_n => rst_n,
bpp_mode => bpp_mode,
clear_buffer => clear_buffer,
ps_buf_wr => ps_buf_wr_int(i),
ps_buf_wr_data => ps_buf_wr_data_int(i),
ps_buf_rdy => ps_buf_rdy_int(i),
ps_buf_last_word => ps_buf_last_word_int(i),
-- Output data
pixel_buf_wr => pixel_buf_wr_int(i),
pixel_buf_wr_data => pixel_buf_wr_data_int(i),
pixel_buf_rdy => pixel_buf_rdy_int(i),
pixel_buf_last_word => pixel_buf_last_word_int(i)
);
end generate;
end generate;
end rtl;

View file

@ -30,9 +30,6 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.pkg_functions.all;
entity freq_counter is
generic (

View file

@ -23,7 +23,7 @@
#
# -------------------------------------------------------------------------- #
QUARTUS_VERSION = "17.0"
QUARTUS_VERSION = "18.1"
DATE = "17:29:20 August 17, 2017"
# Revisions

View file

@ -42,7 +42,7 @@ set_global_assignment -name DEVICE 10CL006YU256C8G
set_global_assignment -name TOP_LEVEL_ENTITY hmb_fpga_top
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 17.0.0
set_global_assignment -name PROJECT_CREATION_TIME_DATE "17:29:20 AUGUST 17, 2017"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 Standard Edition"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 SP0.18std Standard Edition"
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
@ -228,6 +228,9 @@ set_location_assignment PIN_G2 -to led_out[4]
set_location_assignment PIN_G1 -to led_out[5]
set_global_assignment -name VHDL_FILE ../src/hmb_head_monitor.vhd
set_global_assignment -name VERILOG_FILE ../src/simple_i2c_slave.v
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_pkg_auto.vhd
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_csr_decode_auto.vhd
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_csr_regs_auto.vhd
set_global_assignment -name VHDL_FILE ../src/hmb_fpga_top.vhd
set_global_assignment -name QIP_FILE ip/lvds_rx_1ck_16d.qip
set_global_assignment -name QIP_FILE ip/pll_25in_100out.qip

View file

@ -0,0 +1,21 @@
###################################################################
# Makefile for HMB-DG logic synthesis
#
# Copyright (c) 2020 Global Inkjet Systems
#
###################################################################
TOP_NAME = hmb_fpga_top
MAKE_EXE = mingw32-make
QUARTUS_EXE = quartus_sh
OUTDIR = output_files
all:
@${MAKE_EXE} -C ..\test autobuild
@${QUARTUS_EXE} --flow compile ${TOP_NAME}.qpf
clean:
@rm -rf db incremental_db
@rm -rf ${OUTDIR}/*

File diff suppressed because it is too large Load diff

View file

@ -1,22 +1,54 @@
[{
"ip_name" : "hmb_fpga",
"bus" : "csr",
"addr_width" : "16",
"description" : "This block the top level HMB FPGA",
"addr_hi_bit" : "9",
"addr_lo_bit" : "5",
"notes" : "The <tt style='color:#0000c0'>SHUTDN_ENx</tt> registers define which new monitor enables are to be set when an update is instigated. A bit set at 1 will update the equivalent enable. A bit at 0 has no effect, effectively leaving that enable in its previous state. To update the actual enables, the return-to-zero <tt style='color:#0000c0'>SHUTDN_GO</tt> register is written as 1. The enables are then set with the values in the <tt style='color:#0000c0'>SHUTDN_ENx</tt> registers after a delay. The delay is programmed via the <tt style='color:#0000c0'>SHUTDN_DLY_LO</tt>, <tt style='color:#0000c0'>SHUTDN_DLY_MID</tt> and <tt style='color:#0000c0'>SHUTDN_DLY_HI</tt> registers giving 24 bits of delay, in units of the system clock (nominally 10ns). If the delay registers are zero, then the enables are updated immediately on a <tt style='color:#0000c0'>GO</tt>. Otherwise, they are updated after the programmed delay. This mechanism can only set the enable bits. The <tt style='color:#0000c0'>SHUTDN_CLRx</tt> return-to-zero registers are used to clear the monitor enables. Writing a 1 in the bit position will clear that bit. This clearing is immediate, and does not use the delay mechanism. If a delay is in progress the clearing of the enable is ignored. The watch dog is controlled via the <tt style='color:#0000c0'>WD_CTRL</tt> register. The watchdog is enabled with the <tt style='color:#0000c0'>EN</tt> field and must then be periodically cleared by writing 1 to the return-to-zero <tt style='color:#0000c0'>CLR</tt> field. The clearing must occur before the period specified by the <tt style='color:#0000c0'>PERIOD</tt> field, which has units of 100ms. If the watchdog fires, then the <tt style='color:#0000c0'>WD_STATUS</tt> register indicates this. If any event causes a shutdown then the <tt style='color:#0000c0'>SHUTDOWN_MASTER</tt> register indicates this. The actual cause for the shutdown must then be inspected from the individual monitor registers. Some design-for-test registers are provided. The two <tt style='color:#0000c0'>SCRATCHx</tt> registers allow verification of I<sup>2</sup>C communications with the slave FPGA, whilst the <tt style='color:#0000c0'>TEST_TRIP</tt> register allows the artifical generation of a limited number of shutdown events by the software. The <tt style='color:#0000c0'>DBG_LED</tt> register allows the CPU to take control of the LEDs (set <tt style='color:#0000c0'>EN</tt> field) and then set a value (<tt style='color:#0000c0'>VAL</tt> field).",
"sub_blocks" : {
"local" : {
"instance" : "",
"process" : "hdl, cpp, txt",
"offset" : "0x000"
},
"monitor:a" : {
"instance" : "0",
"process" : "cpp",
"offset" : "0x020"
},
"monitor:b" : {
"instance" : "1",
"process" : "cpp",
"offset" : "0x040"
},
"monitor:c" : {
"instance" : "2",
"process" : "cpp",
"offset" : "0x060"
},
"monitor:d" : {
"instance" : "3",
"process" : "cpp",
"offset" : "0x080"
}
},
"registers" : {
"scratch0" : {
"ip_id" : {
"address" : "0",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Scratch register 0"
"description" : "Unique ID for this IP block",
"type" : "c",
"bit_len" : "8",
"reset" : "0x29"
},
"scratch1" : {
"ip_ver" : {
"address" : "1",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Scratch register 1"
"description" : "Version number",
"type" : "c",
"bit_len" : "8",
"reset" : "0x02"
},
"cpu_dbg_led" : {
"address" : "2",
@ -47,76 +79,76 @@
"shutdn_en0" : {
"address" : "4",
"width" : "5",
"description" : "Shutdown trip enables",
"description" : "Shutdown new trip enables for channel 0",
"fields": {
"head_trip" : {
"type" : "w",
"bit_len" : "4",
"reset" : "0",
"description" : "Enable trips from head 0"
"description" : "Set new enable of trips from head 0"
},
"amp_trip" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable trip from amp 0"
"description" : "Set new enable of trip from amp 0"
}
}
},
"shutdn_en1" : {
"address" : "5",
"width" : "5",
"description" : "Shutdown trip enables",
"description" : "Shutdown new trip enables for channel 1",
"fields": {
"head_trip" : {
"type" : "w",
"bit_len" : "4",
"reset" : "0",
"description" : "Enable trips from head 1"
"description" : "Set new enable of trips from head 1"
},
"amp_trip" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable trip from amp 1"
"description" : "Set new enable of trip from amp 1"
}
}
},
"shutdn_en2" : {
"address" : "6",
"width" : "5",
"description" : "Shutdown trip enables",
"description" : "Shutdown new trip enables for channel 2",
"fields": {
"head_trip" : {
"type" : "w",
"bit_len" : "4",
"reset" : "0",
"description" : "Enable trips from head 2"
"description" : "Set new enable of trips from head 2"
},
"amp_trip" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable trip from amp 2"
"description" : "Set new enable of trip from amp 2"
}
}
},
"shutdn_en3" : {
"address" : "7",
"width" : "5",
"description" : "Shutdown trip enables",
"description" : "Shutdown new trip enables for channel 3",
"fields": {
"head_trip" : {
"type" : "w",
"bit_len" : "4",
"reset" : "0",
"description" : "Enable trips from head 3"
"description" : "Set new enable of trips from head 3"
},
"amp_trip" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable trip from amp 3"
"description" : "Set new enable of trip from amp 3"
}
}
},
@ -171,118 +203,28 @@
"type" : "r",
"reset" : "0",
"description" : "Watchdog fire alarm status"
},
"h0_therm_rst" : {
"address" : "64",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Head 0 thermal reset"
},
"h0_therm_trip_status" : {
"address" : "65",
"width" : "3",
"type" : "r",
"reset" : "0",
"description" : "Head 0 thermal trip status"
},
"h0_shutdn_clr" : {
"address" : "66",
},
"scratch0" : {
"address" : "22",
"width" : "8",
"type" : "w0",
"type" : "w",
"reset" : "0",
"description" : "Shutdown clear"
"description" : "Scratch register 0"
},
"h0_shutdn_status" : {
"address" : "67",
"scratch1" : {
"address" : "23",
"width" : "8",
"type" : "r",
"type" : "w",
"reset" : "0",
"description" : "Shutdown status"
"description" : "Scratch register 1"
},
"h1_therm_rst" : {
"address" : "80",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Head 0 thermal reset"
},
"h1_therm_trip_status" : {
"address" : "81",
"width" : "3",
"type" : "r",
"reset" : "0",
"description" : "Head 0 thermal trip status"
},
"h1_shutdn_clr" : {
"address" : "82",
"i2c_timeout" : {
"address" : "24",
"width" : "8",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown clear"
},
"h1_shutdn_status" : {
"address" : "83",
"width" : "8",
"type" : "r",
"reset" : "0",
"description" : "Shutdown status"
},
"h2_therm_rst" : {
"address" : "96",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Head 0 thermal reset"
},
"h2_therm_trip_status" : {
"address" : "97",
"width" : "3",
"type" : "r",
"reset" : "0",
"description" : "Head 0 thermal trip status"
},
"h2_shutdn_clr" : {
"address" : "98",
"width" : "8",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown clear"
},
"h2_shutdn_status" : {
"address" : "99",
"width" : "8",
"type" : "r",
"reset" : "0",
"description" : "Shutdown status"
},
"h3_therm_rst" : {
"address" : "112",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Head 0 thermal reset"
},
"h3_therm_trip_status" : {
"address" : "113",
"width" : "3",
"type" : "r",
"reset" : "0",
"description" : "Head 0 thermal trip status"
},
"h3_shutdn_clr" : {
"address" : "114",
"width" : "8",
"type" : "w0",
"reset" : "0",
"description" : "Shutdown clear"
},
"h3_shutdn_status" : {
"address" : "115",
"width" : "8",
"type" : "r",
"reset" : "0",
"description" : "Shutdown status"
"type" : "w",
"reset" : "60",
"description" : "Number of milliseconds that slave or master i2c can hold bus before being reset"
}
}

View file

@ -37,6 +37,7 @@ use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.hmb_fpga_pkg.all;
entity hmb_fpga_top is
generic(
@ -55,7 +56,7 @@ entity hmb_fpga_top is
shutdown_out : out std_logic;
therm_trip_rst : out std_logic;
-- thermal trips from onboard comparitors looking at therm_N/P[2:0] from head connectors
-- present on FLX-FD-SG600 V1.0
-- not present on FLX-FD-SG1024 V0.0
@ -78,9 +79,13 @@ architecture struct of hmb_fpga_top is
-- Verilog module needs component declaration
component simple_i2c_slave
generic (
FLT_LEN : integer := 20
);
port
(
clk : in std_logic;
reset : in std_logic;
scl_in : in std_logic;
scl_out : out std_logic;
sda_in : in std_logic;
@ -99,39 +104,40 @@ architecture struct of hmb_fpga_top is
type therm_trip_t is array (0 to 3) of std_logic_vector(2 downto 0);
type shutdn_trip_t is array (0 to 3) of std_logic_vector(4 downto 0);
function calcFiltLen(testMode : boolean) return integer is
begin
if testMode then
return 2; -- I2C SCL SDA filter 2 clocks in test mode
else
return 20;-- I2C SCL SDA filter 20 clocks (200ns) in normal mode
end if;
end function calcFiltLen;
constant CYCLES_PER_US : integer := 99;
constant I2C_FLT_LEN : integer := calcFiltLen(TEST_MODE);
constant LVDS_CLK1_BIT : integer range 0 to 32 := 14;
constant I2C_ADDR_SCRATCH0 : std_logic_vector(15 downto 0) := 16x"0000";
constant I2C_ADDR_SCRATCH1 : std_logic_vector(15 downto 0) := 16x"0001";
constant I2C_ADDR_DBG_LED : std_logic_vector(15 downto 0) := 16x"0002";
constant I2C_ADDR_SHTDN_OUT : std_logic_vector(15 downto 0) := 16x"0003";
constant I2C_ADDR_SHUT_EN_H0 : std_logic_vector(15 downto 0) := 16x"0004";
constant I2C_ADDR_SHUT_EN_H1 : std_logic_vector(15 downto 0) := 16x"0005";
constant I2C_ADDR_SHUT_EN_H2 : std_logic_vector(15 downto 0) := 16x"0006";
constant I2C_ADDR_SHUT_EN_H3 : std_logic_vector(15 downto 0) := 16x"0007";
constant I2C_ADDR_TST_SHUTDN : std_logic_vector(15 downto 0) := 16x"0008";
constant I2C_ADDR_WD_CTRL : std_logic_vector(15 downto 0) := 16x"0010";
constant I2C_ADDR_WD_STATUS : std_logic_vector(15 downto 0) := 16x"0011";
constant I2C_ADDR_MON_BASE_H0 : std_logic_vector(15 downto 0) := 16x"0040";
constant I2C_ADDR_MON_BASE_H1 : std_logic_vector(15 downto 0) := 16x"0050";
constant I2C_ADDR_MON_BASE_H2 : std_logic_vector(15 downto 0) := 16x"0060";
constant I2C_ADDR_MON_BASE_H3 : std_logic_vector(15 downto 0) := 16x"0070";
-- System clocks
signal clk100 : std_logic;
signal clk_lvds : std_logic;
signal rst_n : std_logic := '0';
-- I2C signals
signal scl_in : std_logic;
signal scl_out : std_logic;
signal sda_in : std_logic;
signal sda_out : std_logic;
signal address : std_logic_vector(15 downto 0);
signal wr_data : std_logic_vector(7 downto 0);
signal rd_data : std_logic_vector(7 downto 0);
signal wr_en : std_logic := '0';
signal rd_en : std_logic := '0';
signal avs_csr_address : std_logic_vector(15 downto 0);
signal avs_csr_writedata : std_logic_vector(31 downto 0) := (others => '0');
signal avs_csr_readdata : std_logic_vector(31 downto 0) := (others => '0');
signal avs_csr_write : std_logic := '0';
signal avs_csr_read : std_logic := '0';
signal local_readdata : std_logic_vector(31 downto 0);
signal local_read : std_logic;
signal local_write : std_logic;
signal rd_dv : std_logic := '0';
-- LEDs
@ -145,7 +151,8 @@ architecture struct of hmb_fpga_top is
signal data_d2 : std_logic_vector(111 downto 0);
-- Shutdown signals
signal hd_mon_csel : std_logic_vector(3 downto 0) := (others => '0');
signal hd_mon_wr : std_logic_vector(3 downto 0) := (others => '0');
signal hd_mon_rd : std_logic_vector(3 downto 0) := (others => '0');
signal shutdown_int : std_logic_vector(3 downto 0) := (others => '0');
signal shutdn_trip_en : std_logic_vector(4 * 5 - 1 downto 0) := (others => '0');
@ -177,16 +184,30 @@ architecture struct of hmb_fpga_top is
signal test_shtdn : std_logic_vector(7 downto 0) := 8x"0";
signal shutdown_comb : std_logic;
signal i2c_slv_reset : std_logic := '0';
signal i2c_slv_active_uscnt : integer range 0 to 101 := 0;
signal i2c_slv_active_uscnt_tick : std_logic := '0';
signal i2c_slv_active_mscnt : integer range 0 to 1001 := 0;
signal i2c_slv_active_mscnt_tick : std_logic := '0';
signal i2c_slv_active_ms : integer range 0 to 255 := 0;
signal i2c_slv_reset_count : std_logic_vector(7 downto 0) := (others => '0');
signal i2c_timeout : std_logic_vector(7 downto 0);
begin
------------------------------------------------------------------------------
-- I/O Assignments
------------------------------------------------------------------------------
shutdown_out <= shutdown_int(0) or
shutdown_int(1) or
shutdown_int(2) or
shutdown_int(3) or
wd_alarm;
shutdown_out <= shutdown_comb;
shutdown_comb <= shutdown_int(0) or
shutdown_int(1) or
shutdown_int(2) or
shutdown_int(3) or
wd_alarm;
therm_trip_rst <= therm_en(0) or
therm_en(1) or
@ -234,11 +255,11 @@ begin
hd_mon_inst : entity work.hmb_head_monitor
port map(
clk => clk100,
rst_n => '1',
avs_csr_address => address(3 downto 0),
avs_csr_write => (hd_mon_csel(i) and wr_en),
avs_csr_writedata => (24x"0" & wr_data),
avs_csr_read => (hd_mon_csel(i) and rd_en),
rst_n => rst_n,
avs_csr_address => avs_csr_address(3 downto 0),
avs_csr_write => hd_mon_wr(i),
avs_csr_writedata => (avs_csr_writedata),
avs_csr_read => hd_mon_rd(i),
avs_csr_readdata => mon_read_data(i),
n_therm_trip_in => n_therm_trip(i),
therm_enable_out => therm_en(i),
@ -266,6 +287,10 @@ begin
clk_en_10hz <= '0';
end if;
if rst_n = '0' and cnt_10hz > 100 then
rst_n <= '1';
end if;
if clk_en_10hz = '1' then
-- Change led scan direction when end LEDs are set.
@ -301,25 +326,96 @@ begin
end process;
led_out <= cpu_led(5 downto 1) when cpu_led(0) = '1' else led(5) & data_d1(20) & data_d1(41) & data_d1(62) & data_d1(83);
--led_out <= cpu_led(5 downto 1) when cpu_led(0) = '1' else led(5) & data_d1(20) & data_d1(41) & data_d1(62) & data_d1(83);
led_out <= '0' & clk_pclk & data_d1(12) & data_d1(9) & data_d1(0);
------------------------------------------------------------------------------
-- Instantiate I2C slave
------------------------------------------------------------------------------
process(clk100)
begin
if rising_edge(clk100) then
-- Read data is valid the cycle after avs_csr_read is asserted
rd_dv <= avs_csr_read;
end if;
end process;
I2C_SLAVE_MON: process (clk100)
begin
if clk100'event and clk100 = '1' then
-- defaults
i2c_slv_reset <= '0';
i2c_slv_active_uscnt_tick <= '0';
i2c_slv_active_mscnt_tick <= '0';
if rst_n = '0' then
i2c_slv_active_uscnt <= 0;
i2c_slv_active_mscnt <= 0;
i2c_slv_active_ms <= 0;
elsif (scl_out = '0' or sda_out = '0') then
i2c_slv_active_uscnt <= i2c_slv_active_uscnt + 1;
if i2c_slv_active_uscnt = 99 then
i2c_slv_active_uscnt_tick <= '1';
i2c_slv_active_uscnt <= 0;
end if;
if i2c_slv_active_uscnt_tick = '1' then
i2c_slv_active_mscnt <= i2c_slv_active_mscnt + 1;
if ((i2c_slv_active_mscnt = 999 and not TEST_MODE)
or (i2c_slv_active_mscnt = 9 and TEST_MODE)) then
i2c_slv_active_mscnt_tick <= '1';
i2c_slv_active_mscnt <= 0;
end if;
end if;
if i2c_slv_active_mscnt_tick = '1' then
i2c_slv_active_ms <= i2c_slv_active_ms + 1;
if i2c_slv_active_ms = to_integer(unsigned(i2c_timeout)) then -- I2C bus stuck. We have been driving SCL or SDA low for > Timeout ms
i2c_slv_reset <= '1';
i2c_slv_active_ms <= 0;
end if;
end if;
else
i2c_slv_active_uscnt <= 0;
i2c_slv_active_uscnt_tick <= '0';
i2c_slv_active_ms <= 0;
end if;
if rst_n = '0' then
i2c_slv_reset_count <= (others => '0');
if TEST_MODE then
i2c_slv_reset_count(0) <= '1'; -- so can check readback works
end if;
elsif i2c_slv_reset = '1' then
if i2c_slv_reset_count /= x"FF" then
i2c_slv_reset_count <= std_logic_vector(unsigned(i2c_slv_reset_count) + 1);
end if;
end if;
end if;
end process;
simple_i2c_slave_inst : simple_i2c_slave
generic map (
FLT_LEN => I2C_FLT_LEN
)
port map(
clk => clk100,
reset => i2c_slv_reset or not rst_n,
scl_in => scl_in,
scl_out => scl_out,
sda_in => sda_in,
sda_out => sda_out,
i2c_busy_out => open,
add_out => address,
wr_data_out => wr_data,
wr_en_out => wr_en,
rd_en_out => rd_en,
rd_data_in => rd_data,
add_out => avs_csr_address,
wr_data_out => avs_csr_writedata(7 downto 0),
wr_en_out => avs_csr_write,
rd_en_out => avs_csr_read,
rd_data_in => avs_csr_readdata(7 downto 0),
rd_dv_in => rd_dv
);
@ -352,7 +448,7 @@ begin
-- In test mode, wire the compare counter to the micorsecnd counter
-- to speed up simulations
GEN_CMP_CNT_TEST : if TEST_MODE = true generate
GEN_CMP_CNT_TEST : if TEST_MODE generate
cmp_count <= us_count(3 downto 0);
@ -366,7 +462,7 @@ begin
end if;
-- If watchdog enabled and no shut down, count the time
if en_wd = '1' and shutdown_out = '0' then
if en_wd = '1' and shutdown_comb = '0' then
clk_count <= std_logic_vector(unsigned(clk_count) + 1);
@ -401,65 +497,77 @@ begin
------------------------------------------------------------------------------
-- Create registers (non-monitor) and address decoding
-- Create registers (non-monitor) and avs_csr_address decoding
------------------------------------------------------------------------------
hd_mon_csel(0) <= '1' when (address(15 downto 4) = I2C_ADDR_MON_BASE_H0(15 downto 4)) else '0';
hd_mon_csel(1) <= '1' when (address(15 downto 4) = I2C_ADDR_MON_BASE_H1(15 downto 4)) else '0';
hd_mon_csel(2) <= '1' when (address(15 downto 4) = I2C_ADDR_MON_BASE_H2(15 downto 4)) else '0';
hd_mon_csel(3) <= '1' when (address(15 downto 4) = I2C_ADDR_MON_BASE_H3(15 downto 4)) else '0';
hmb_fpga_csr_decode_inst : entity work.hmb_fpga_csr_decode
generic map (
ADDR_DECODE_HI_BIT => 9,
ADDR_DECODE_LO_BIT => 5
)
port map (
process(clk100)
begin
if rising_edge(clk100) then
local_write => local_write,
local_read => local_read,
local_readdata => local_readdata,
monitor_0_write => hd_mon_wr(0),
monitor_0_read => hd_mon_rd(0),
monitor_0_readdata => mon_read_data(0),
monitor_1_write => hd_mon_wr(1),
monitor_1_read => hd_mon_rd(1),
monitor_1_readdata => mon_read_data(1),
monitor_2_write => hd_mon_wr(2),
monitor_2_read => hd_mon_rd(2),
monitor_2_readdata => mon_read_data(2),
monitor_3_write => hd_mon_wr(3),
monitor_3_read => hd_mon_rd(3),
monitor_3_readdata => mon_read_data(3),
-- Default register values
clr_wd <= '0';
rd_data <= 8x"0";
test_shtdn <= 8x"0";
avs_address => avs_csr_address(9 downto 5),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
-- Read data is valid the cycle after rd_en is asserted
rd_dv <= rd_en;
);
-- Write registers
if wr_en = '1' then
case address is
when I2C_ADDR_SCRATCH0 => scratch0 <= wr_data(7 downto 0);
when I2C_ADDR_SCRATCH1 => scratch1 <= wr_data(7 downto 0);
when I2C_ADDR_DBG_LED => cpu_led <= wr_data(5 downto 0);
when I2C_ADDR_TST_SHUTDN => test_shtdn <= wr_data(7 downto 0);
when I2C_ADDR_SHUT_EN_H0 => shutdn_trip_en(4 downto 0) <= wr_data(4 downto 0);
when I2C_ADDR_SHUT_EN_H1 => shutdn_trip_en(9 downto 5) <= wr_data(4 downto 0);
when I2C_ADDR_SHUT_EN_H2 => shutdn_trip_en(14 downto 10) <= wr_data(4 downto 0);
when I2C_ADDR_SHUT_EN_H3 => shutdn_trip_en(19 downto 15) <= wr_data(4 downto 0);
when I2C_ADDR_WD_CTRL => clr_wd <= wr_data(0);
en_wd <= wr_data(1);
wd_period <= wr_data(5 downto 2);
when others => null;
end case;
end if;
hmb_fpga_csr_regs_inst : entity work.hmb_fpga_csr_regs
generic map(
ADDR_DECODE_WIDTH => 5
)
port map(
-- Clock and reset
clk => clk100,
rst_n => rst_n,
-- Read registers
case? address is
when I2C_ADDR_SCRATCH0 => rd_data(7 downto 0) <= scratch0;
when I2C_ADDR_SCRATCH1 => rd_data(7 downto 0) <= scratch1;
when I2C_ADDR_DBG_LED => rd_data(5 downto 0) <= cpu_led;
when I2C_ADDR_SHTDN_OUT => rd_data(0) <= shutdown_out;
when I2C_ADDR_SHUT_EN_H0 => rd_data(3 downto 0) <= shutdn_trip_en(3 downto 0);
when I2C_ADDR_SHUT_EN_H1 => rd_data(3 downto 0) <= shutdn_trip_en(7 downto 4);
when I2C_ADDR_SHUT_EN_H2 => rd_data(3 downto 0) <= shutdn_trip_en(11 downto 8);
when I2C_ADDR_SHUT_EN_H3 => rd_data(3 downto 0) <= shutdn_trip_en(15 downto 12);
when I2C_ADDR_MON_BASE_H0(15 downto 4) & "----" => rd_data <= mon_read_data(0)(7 downto 0);
when I2C_ADDR_MON_BASE_H1(15 downto 4) & "----" => rd_data <= mon_read_data(1)(7 downto 0);
when I2C_ADDR_MON_BASE_H2(15 downto 4) & "----" => rd_data <= mon_read_data(2)(7 downto 0);
when I2C_ADDR_MON_BASE_H3(15 downto 4) & "----" => rd_data <= mon_read_data(3)(7 downto 0);
when I2C_ADDR_WD_CTRL => rd_data(5 downto 0) <= wd_period & en_wd & clr_wd;
when I2C_ADDR_WD_STATUS => rd_data(0) <= wd_alarm;
when others => rd_data(0) <= '0';
end case?;
end if;
scratch0 => scratch0,
scratch1 => open,
cpu_dbg_led_en => cpu_led(0),
cpu_dbg_led_val => cpu_led(5 downto 1),
shutdown_master => shutdown_comb,
shutdn_en0_head_trip => shutdn_trip_en(3 downto 0),
shutdn_en0_amp_trip => shutdn_trip_en(4),
shutdn_en1_head_trip => shutdn_trip_en(8 downto 5),
shutdn_en1_amp_trip => shutdn_trip_en(9),
shutdn_en2_head_trip => shutdn_trip_en(13 downto 10),
shutdn_en2_amp_trip => shutdn_trip_en(14),
shutdn_en3_head_trip => shutdn_trip_en(18 downto 15),
shutdn_en3_amp_trip => shutdn_trip_en(19),
test_trip_head_trip => test_shtdn(3 downto 0),
test_trip_amp_trip => test_shtdn(7 downto 4),
wd_ctrl_clr => clr_wd,
wd_ctrl_en => en_wd,
wd_ctrl_period => wd_period,
wd_status => wd_alarm,
end process;
i2c_timeout => i2c_timeout,
avs_address => avs_csr_address(4 downto 0),
avs_write => local_write,
avs_writedata => avs_csr_writedata,
avs_read => local_read,
avs_readdata => local_readdata
);
------------------------------------------------------------------------------
-- Instantiate deserialiser, 16 channel, 7:1, max 100MHz clock

View file

@ -146,6 +146,7 @@ end generate;
-- default values
therm_en_req <= '0'; -- any bit set by CSR write must by single cycle one-shot
shutdown_trip_clr_reg <= (others => '0'); -- any bit set by CSR write must by single cycle one-shot
avs_csr_readdata <= (others => '0');
-- write logic
if (avs_csr_write = '1') then

View file

@ -21,6 +21,7 @@
module simple_i2c_slave
(
input wire clk,
input wire reset,
input wire scl_in,
output wire scl_out,
input wire sda_in,
@ -39,6 +40,8 @@ module simple_i2c_slave
//----------------------------------------------------------------------------
// Parameters
localparam DEVICE_ADDRESS = 7'h39; // 7 bit Device Address
parameter WR_SIZE = 2'd3;
parameter FLT_LEN = 20; // Number of 100M clocks that signal is high or low to recognise
// Timing
// I2C State Machine States
@ -50,8 +53,12 @@ localparam TX_BYTE = 3'd4;
// Internal Signals
reg [2:0] scl_sr = 3'b111;
reg [2:0] sda_sr = 3'b111;
reg [FLT_LEN-1:0] scl_sr = {FLT_LEN{1'b1}};
reg [FLT_LEN-1:0] sda_sr = {FLT_LEN{1'b1}};
reg scl_filt = 1'b1;
reg sda_filt = 1'b1;
reg scl_filt_d = 1'b1;
reg sda_filt_d = 1'b1;
wire scl_re;
wire scl_fe;
@ -70,7 +77,7 @@ reg rnw = 1'b0;
reg [2:0] next_state = RX_BYTE;
reg [2:0] state = IDLE;
reg [15:0] add = 16'd0;
reg [7:0] wr_data = 8'd0;
reg wr_en = 1'b0;
@ -93,17 +100,40 @@ assign rd_en_out = read_pending;
//----------------------------------------------------------------------------
always @(posedge clk)
begin
scl_sr <= {scl_sr[1:0], scl_in};
sda_sr <= {sda_sr[1:0], sda_in};
if (reset == 1'b1) begin
scl_sr <= {FLT_LEN{1'b1}};
sda_sr <= {FLT_LEN{1'b1}};
scl_filt <= 1'b1;
sda_filt <= 1'b1;
scl_filt_d <= 1'b1;
sda_filt_d <= 1'b1;
end
else begin
scl_sr <= {scl_sr[FLT_LEN-2:0], scl_in};
sda_sr <= {sda_sr[FLT_LEN-2:0], sda_in};
if (&scl_sr[FLT_LEN-1:1] == 1'b1)
scl_filt <= 1'b1;
else if (|scl_sr[FLT_LEN-1:1] == 1'b0)
scl_filt <= 1'b0;
if (&sda_sr[FLT_LEN-1:1] == 1'b1)
sda_filt <= 1'b1;
else if (|sda_sr[FLT_LEN-1:1] == 1'b0)
sda_filt <= 1'b0;
scl_filt_d <= scl_filt;
sda_filt_d <= sda_filt;
end
end
assign scl_re = (scl_sr[2:1] == 2'b01);
assign scl_fe = (scl_sr[2:1] == 2'b10);
assign scl_hi = (scl_sr[2:1] == 2'b11);
assign sda_re = (sda_sr[2:1] == 2'b01);
assign sda_fe = (sda_sr[2:1] == 2'b10);
assign scl_re = ( scl_filt & !scl_filt_d);
assign scl_fe = (!scl_filt & scl_filt_d);
assign scl_hi = ( scl_filt);
assign sda_re = ( sda_filt & !sda_filt_d);
assign sda_fe = (!sda_filt & sda_filt_d);
assign start = sda_fe & scl_hi;
assign stop = sda_re & scl_hi;
@ -120,151 +150,174 @@ reg [7:0] rd_data = 8'd0;
//----------------------------------------------------------------------------
always @(posedge clk)
begin
case (state)
IDLE:
begin
bit_cnt <= 3'd0;
byte_cnt <= 2'd0;
sda <= 1'b1;
scl <= 1'b1;
wr_en <= 1'b0;
read_pending <= 1'b0;
i2c_busy <= 1'b0;
if (reset)
begin
state <= IDLE;
bit_cnt <= 3'd0;
byte_cnt <= 2'd0;
sda <= 1'b1;
scl <= 1'b1;
wr_en <= 1'b0;
read_pending <= 1'b0;
i2c_busy <= 1'b0;
if (start)
rnw <= 1'b0;
next_state <= RX_BYTE;
add <= 16'd0;
wr_data <= 8'd0;
rd_byte <= 8'd0;
rd_data <= 8'd0;
end
else
begin
case (state)
IDLE:
begin
state <= RX_BYTE;
end
end
bit_cnt <= 3'd0;
byte_cnt <= 2'd0;
sda <= 1'b1;
scl <= 1'b1;
wr_en <= 1'b0;
read_pending <= 1'b0;
i2c_busy <= 1'b0;
RX_BYTE :
if (stop)
begin
state <= IDLE;
end
else if (scl_re)
begin
rd_byte <= {rd_byte[6:0], sda_in}; // Read in next bit
bit_cnt <= bit_cnt + 3'd1; // Increment bit counter
if (&bit_cnt)
begin
state <= SLV_ACK; // If last bit, go to Slave Acknowledge state
end
end
SLV_ACK:
if (stop)
begin
state <= IDLE;
end
else if (scl_fe)
begin
byte_cnt <= byte_cnt + 2'd1; // Increment the byte count
if ((byte_cnt == 2'd0) & (rd_byte[7:1] == DEVICE_ADDRESS))
i2c_busy <= 1'b1; // Assert so I/O control passes this through
if ((byte_cnt == 2'd0) & (rd_byte[7:1] != DEVICE_ADDRESS))
state <= IDLE; // If not for us, ignore
else
state <= ACK_HOLD; // Otherwise respond
if (rd_byte[0] & (byte_cnt == 2'd0))
next_state <= TX_BYTE;
else if (byte_cnt == 3'd3)
next_state <= IDLE;
else
next_state <= RX_BYTE;
if (byte_cnt == 2'd0)
rnw <= rd_byte[0];
if (~rnw)
begin
if (byte_cnt == 2'd1)
add[15:8] <= rd_byte;
if (byte_cnt == 2'd2)
add[7:0] <= rd_byte;
if (byte_cnt == 2'd3)
wr_data <= rd_byte;
end
wr_en <= ((~rnw) & (byte_cnt == 3'd3)); // Assert write strobe if last byte of a write command
read_pending <= rd_byte[0] & (byte_cnt == 2'd0);
if (byte_cnt == 8'd0)
sda <= (rd_byte[7:1] != DEVICE_ADDRESS); // If receiving byte address, verify before asserting ACK
else
sda <= 1'b0; // Send ACK once line is clear
end
ACK_HOLD:
if (stop)
begin
state <= IDLE;
wr_en <= 1'b0; // Clear write enable
end
else
begin
wr_en <= 1'b0; // Clear write enable
if (rd_dv_in)
if (start)
begin
read_pending <= 1'b0;
rd_data <= rd_data_in;
end
if (scl_fe)
begin
sda <= 1'b1; // On next falling edge, deassert SDA
scl <= ~read_pending; // If we're waiting for a read, keep SCL low
state <= next_state;
state <= RX_BYTE;
end
end
TX_BYTE:
RX_BYTE :
if (stop)
begin
state <= IDLE;
state <= IDLE;
end
else
else if (scl_re)
begin
if (rd_dv_in)
begin
read_pending <= 1'b0;
rd_data <= rd_data_in;
end
rd_byte <= {rd_byte[6:0], sda_in}; // Read in next bit
bit_cnt <= bit_cnt + 3'd1; // Increment bit counter
scl <= ~read_pending; // Keep SCL low until read is complete
sda <= rd_data[7];
if (scl_fe)
begin
rd_data <= {rd_data[6:0], 1'b0}; // Read in next bit
bit_cnt <= bit_cnt + 3'd1; // Increment bit counter
if (&bit_cnt)
state <= IDLE; // If last bit sent, go to idle condition
end
if (&bit_cnt)
begin
state <= SLV_ACK; // If last bit, go to Slave Acknowledge state
end
end
SLV_ACK:
if (stop)
begin
state <= IDLE;
end
else if (scl_fe)
begin
byte_cnt <= byte_cnt + 2'd1; // Increment the byte count
default :
begin // If we end up here, go to IDLE
bit_cnt <= 3'd0;
byte_cnt <= 2'd0;
sda <= 1'b1;
scl <= 1'b1;
read_pending <= 1'b0;
state <= IDLE;
end
if ((byte_cnt == 2'd0) & (rd_byte[7:1] == DEVICE_ADDRESS))
i2c_busy <= 1'b1; // Assert so I/O control passes this through
endcase
if ((byte_cnt == 2'd0) & (rd_byte[7:1] != DEVICE_ADDRESS))
state <= IDLE; // If not for us, ignore
else
state <= ACK_HOLD; // Otherwise respond
if (rd_byte[0] & (byte_cnt == 2'd0))
next_state <= TX_BYTE;
else if (byte_cnt == 3'd3)
next_state <= IDLE;
else
next_state <= RX_BYTE;
if (byte_cnt == 2'd0)
rnw <= rd_byte[0];
if (~rnw)
begin
if (byte_cnt == 2'd1)
add[15:8] <= rd_byte;
if (byte_cnt == 2'd2)
add[7:0] <= rd_byte;
if (byte_cnt == 2'd3)
wr_data <= rd_byte;
end
wr_en <= ((~rnw) & (byte_cnt == WR_SIZE)); // Assert write strobe if last byte of a write command
read_pending <= rd_byte[0] & (byte_cnt == 2'd0);
if (byte_cnt == 8'd0)
sda <= (rd_byte[7:1] != DEVICE_ADDRESS); // If receiving byte address, verify before asserting ACK
else
sda <= 1'b0; // Send ACK once line is clear
end
ACK_HOLD:
if (stop)
begin
state <= IDLE;
wr_en <= 1'b0; // Clear write enable
end
else
begin
wr_en <= 1'b0; // Clear write enable
if (rd_dv_in)
begin
read_pending <= 1'b0;
rd_data <= rd_data_in;
end
if (scl_fe)
begin
sda <= 1'b1; // On next falling edge, deassert SDA
scl <= ~read_pending; // If we're waiting for a read, keep SCL low
state <= next_state;
end
end
TX_BYTE:
if (stop)
begin
state <= IDLE;
end
else
begin
if (rd_dv_in)
begin
read_pending <= 1'b0;
rd_data <= rd_data_in;
end
scl <= ~read_pending; // Keep SCL low until read is complete
sda <= rd_data[7];
if (scl_fe)
begin
rd_data <= {rd_data[6:0], 1'b0}; // Read in next bit
bit_cnt <= bit_cnt + 3'd1; // Increment bit counter
if (&bit_cnt)
state <= IDLE; // If last bit sent, go to idle condition
end
end
default :
begin // If we end up here, go to IDLE
bit_cnt <= 3'd0;
byte_cnt <= 2'd0;
sda <= 1'b1;
scl <= 1'b1;
read_pending <= 1'b0;
state <= IDLE;
end
endcase
end
end

View file

@ -7,4 +7,6 @@
@py -3 %FWTOOLSDIR%\gen_htm.py -j .\doc\test.json -b csr -B
@REM Add project specific build here. Normally just point to top of the repository for hierarchical scan
@py -3 %FWTOOLSDIR%\gen_elhal.py -j .\doc\test.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -j .\doc\test.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -j ..\doc\hmb_fpga.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_hdl.py -j ..\doc\hmb_fpga.json -b csr -s _auto

View file

@ -9,6 +9,9 @@
../build/ip/io_buf_i2c.vhd
../build/ip/lvds_rx_1ck_16d.vhd
../build/ip/pll_25in_100out.vhd
../src/hmb_fpga_pkg_auto.vhd
../src/hmb_fpga_csr_decode_auto.vhd
../src/hmb_fpga_csr_regs_auto.vhd
../src/hmb_head_monitor.vhd
../src/hmb_fpga_top.vhd

View file

@ -8,68 +8,102 @@
# User files to build, passed in to vproc makefile build
USERCODE = VUserMain0.cpp utils.cpp runTest.cpp
MODELSIMDIR = c:\altera_18_1\ver\modelsim_ae
FWDEVTOOLS = e:/git/fw_development_tools
VPROCDIR = ${FWDEVTOOLS}/verification/vproc
MODELSIMDIR = c:\altera\ver\modelsim_ae
MODELSIMDIRAUX = c:\altera\ver\modelsim_ase
FWDEVTOOLS = ../../../../fw_development_tools
VPROCDIR = ${FWDEVTOOLS}/verification/vproc
# Name of gnu-make executable
MAKE_EXE = mingw32-make
MAKE_EXE = mingw32-make
VSIMEXE = ${MODELSIMDIR}\\win32aloem\\vsim
VSIMEXEAUX = ${MODELSIMDIRAUX}\\win32aloem\\vsim
AUTOSCRIPT = autogen.bat
CMDSHELL = cmd /c
# Pick single target files for two auto-generations---UUT and test.
# Pick single target files for two auto-generations---UUT and test.
# The core.h file is always presentfor the UUT, and the test package
# for the test bench
TBAUTOFILE = test_pkg_auto.vhd
JSONFILES = doc/*.json
JSONFILES = doc/*.json ../doc/*.json
# If no external code directory (e.g. a HAL) set this to local source directory, else set to code directory
EXTINCLDIR = ${CURDIR}/src
# Add -DVPROC_VHDL to this variable if using the VHDL models for VProc and memory model
HALCOPTS = -DVPROC_VHDL
VSIMARGS =
VSIMARGS =
#------------------------------------------------------
# BUILD RULES
#------------------------------------------------------
# Build is dependant on generating the auto-gen file and
# Build is dependant on generating the auto-gen file and
# processing makefile in vproc
all: ${TBAUTOFILE} vproc
# Make test bench auto-gen code dependant on all the JSON files to
# Make test bench auto-gen code dependant on all the JSON files to
# call the batch file if any have changed
${TBAUTOFILE}: ${JSONFILES}
@cmd /c autogen.bat
@${CMDSHELL} ${AUTOSCRIPT}
# Call the vproc make file for it to determine if anything
# needs building.
.PHONY : vproc
vproc:
@${MAKE_EXE} -C ${VPROCDIR} \
TESTDIR=${CURDIR} \
USER_C="${USERCODE}" \
MODELSIMDIR="${MODELSIMDIR}" \
EXTINCLDIR="${EXTINCLDIR}" \
HALCOPTS="${HALCOPTS}"
TESTDIR=${CURDIR} \
USER_C="${USERCODE}" \
MODELSIMDIR="${MODELSIMDIR}" \
EXTINCLDIR="${EXTINCLDIR}" \
HALCOPTS="${HALCOPTS}"
#------------------------------------------------------
# EXECUTION RULES
#------------------------------------------------------
run: all
@${MODELSIMDIR}\win32aloem\vsim -c -do sim.do ${VSIMARGS}
@${VSIMEXE} -c -do sim.do ${VSIMARGS}
rungui: all
@${MODELSIMDIR}\\win32aloem\\vsim -gui -do simg.do ${VSIMARGS}
@${VSIMEXE} -gui -do simg.do ${VSIMARGS}
runlog: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXE} -c -do simlog.do ${VSIMARGS}
runfree: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXEAUX} -c -do simlog.do ${VSIMARGS}
compile:
@${MODELSIMDIR}\\win32aloem\\vsim -c -do compile.do -do quit
@${VSIMEXE} -c -do compile.do -do quit
waves:
@${VSIMEXEAUX} -view vsim.wlf -do wave.do
autobuild:
@${CMDSHELL} ${AUTOSCRIPT}
gui: rungui
sim: run
log: runlog
free: runfree
help:
@echo "make help Display this message"
@echo "make Build C/C++ code without running simulation"
@echo "make compile Build HDL code without running simulation"
@echo "make autobuild Build auto-generated code without running simulation"
@echo "make run/sim Build and run batch simulation"
@echo "make rungui/gui Build and run GUI simulation"
@echo "make runlog/log Build and run batch simulation with signal logging"
@echo "make runfree/free Build and run batch simulation with signal logging on free starter ModelSim"
@echo "make waves Run wave view in free starter ModelSim (to view runlog/runfree signals)"
#------------------------------------------------------
# CLEANING RULES
#------------------------------------------------------

View file

@ -0,0 +1,774 @@
/**************************************************************/
/* runTest.cpp Date: 2019/09/03 */
/* */
/* Copyright (c) 2019 GIS. All rights reserved. */
/* */
/**************************************************************/
#include <stdio.h>
#include "tb.h"
#include "runTest.h"
#include "utils.h"
extern "C" {
#include "VUser.h"
}
// --------------------------------------------------
// Test code
// --------------------------------------------------
int runTest::start(int node)
{
int error = 0;
// ------------------------------------
// Create a test bench object for local
// TB register access.
CTestAuto* pTestBench = new CTestAuto((uint32_t*)(0));
clkFreqMHz = pTestBench->pConfig->GetClkFreq();
i2cFreqKHz = pTestBench->pConfig->GetI2cFreq();
testLvds = pTestBench->pConfig->GetTestLvds();
VPrint("\nNODE%d: Starting main tests...\n", node);
VPrint("NODE%d: Configuration: clkFreqMHz=%d i2cFreqKHz=%d testLvds=%d\n", node, clkFreqMHz, i2cFreqKHz, testLvds ? 1 : 0);
// Run all the tests
error |= i2c_if_test (pTestBench);
//error |= therm_trip_test (pTestBench);
//error |= therm_trip_rst_test (pTestBench);
//error |= therm_trip_reset_level_test (pTestBench);
//error |= shutdn_trip_test (pTestBench);
//error |= shutdn_en_dly_test (pTestBench);
//error |= watchdog_test (pTestBench);
// Only test the LVDS data path if enabled in the TB configuration.
// This test should be last as it enable sthe LVDS clocking which slows
// the simulator down and the other tests do not need this.
//if (testLvds)
//{
//error |= serdes_test (pTestBench);
//}
// Return status to calling function
return error ? TEST_ERROR : NOERROR;
}
// --------------------------------------------------
// SERDES test
// --------------------------------------------------
//uint32_t runTest::serdes_test (CTestAuto* pTestBench)
//{
//uint32_t error = 0;
//uint32_t data;
//bool seen_error = false;
//VPrint(" Starting LVDS SERDES tests\n");
//// Enable the LVDS clock
//pTestBench->pLvdsClkEn->SetLvdsClkEn(1);
//nsleepSim(300);
//for (int idx = 0; idx < 88; idx++)
//{
//// Each 19th bit in the data out is intercepted
//// and a clock placed on the bit so skip
//if ((idx % 22) == 18)
//continue;
//// Set bit on LVDS parallel busy
//switch(idx / 32)
//{
//case 0 : pTestBench->pLvdsTxParLo->SetLvdsTxParLo ((1 << (idx % 32))); break;
//case 1 : pTestBench->pLvdsTxParMid->SetLvdsTxParMid((1 << (idx % 32))); break;
//case 2 : pTestBench->pLvdsTxParHi->SetLvdsTxParHi ((1 << (idx % 32))); break;
//}
//// Allow the data to propogate through the LVDS SERDES chain.
//nsleepSim(250);
//for (int jdx = 0; jdx < 3; jdx ++)
//{
//// Read all d_out bits and check only lvds input set bit is 1
//switch(jdx)
//{
//case 0 : data = pTestBench->pDOutLo->GetDOutLo () ; break;
//case 1 : data = pTestBench->pDOutMid->GetDOutMid(); break;
//case 2 : data = pTestBench->pDOutHi->GetDOutHi (); break;
//}
//uint32_t exp = ((idx /32) == jdx) ? ( 1 << (idx % 32)) : 0;
//if (data != exp)
//{
//if (!seen_error)
//{
//VPrint("**ERROR 500: d_out status for bit %d at word %d. (got 0x%08x, exp 0x%08x)\n", idx, jdx, data, exp);
//error |= 1;
//}
//}
//}
//seen_error = error;
//// Clear bit
//switch(idx / 32)
//{
//case 0 : pTestBench->pLvdsTxParLo->SetLvdsTxParLo (0); break;
//case 1 : pTestBench->pLvdsTxParMid->SetLvdsTxParMid(0); break;
//case 2 : pTestBench->pLvdsTxParHi->SetLvdsTxParHi (0); break;
//}
//}
//return error;
//}
// --------------------------------------------------
// Watchdog test
// --------------------------------------------------
//uint32_t runTest::watchdog_test(CTestAuto* pTestBench)
//{
//uint32_t error = 0;
//uint32_t data;
//uint32_t status;
//VPrint(" Starting watchdog tests\n");
//// Enable and Clear
//i2cWrite(I2C_ADDR_WD_CTRL, WD_DEFAULT_PERIOD | WD_EN | WD_CLR, pTestBench);
//// Check it didn't fire
//i2cRead(I2C_ADDR_WD_STATUS, data, pTestBench);
//if (data)
//{
//VPrint("**ERROR 400: Bad watchdog status. (got 0x%02d, exp 0x%02d)\n", data, 0);
//error |= 1;
//}
//// Clear
//i2cWrite(I2C_ADDR_WD_CTRL, WD_DEFAULT_PERIOD | WD_EN | WD_CLR, pTestBench);
//// Wait for past firing time
//nsleepSim(10100);
//// Check it fired
//i2cRead(I2C_ADDR_WD_STATUS, data, pTestBench);
//if (data != 1)
//{
//VPrint("**ERROR 401: Bad watchdog status. (got 0x%02d, exp 0x%02d)\n", data, 1);
//error |= 1;
//}
//// Check shutdown in TB status is set
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status == 0)
//{
//VPrint("**ERROR 402: bad test bench trip status for watchdog. (got 0x%02d, exp 0x%02d)\n", status, 1);
//error |= 1;
//}
//// Disable watchdog
//i2cWrite(I2C_ADDR_WD_CTRL, WD_DEFAULT_PERIOD, pTestBench);
//// Check cleared
//i2cRead(I2C_ADDR_WD_STATUS, data, pTestBench);
//if (data)
//{
//VPrint("**ERROR 403: Bad watchdog status. (got 0x%02d, exp 0x%02d)\n", data, 0);
//error |= 1;
//}
//// Check shutdown deasserted
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status != 0)
//{
//VPrint("**ERROR 404: bad test bench trip status for watchdog. (got 0x%02d, exp 0x%02d)\n", status, 1);
//error |= 1;
//}
//return error;
//}
//// --------------------------------------------------
// Thermal trip test
// --------------------------------------------------
//uint32_t runTest::therm_trip_rst_test(CTestAuto* pTestBench)
//{
//int error = 0;
//VPrint(" Starting thermal trip reset tests\n");
//for (int head = 0; head < 4; head++)
//{
//// Clear therm_trip_rst_count in TB
//pTestBench->pClrThermRstCount->SetClrThermRstCount(1);
//uint32_t monBaseSpacing = I2C_ADDR_MON_BASE_H1 - I2C_ADDR_MON_BASE_H0;
//// Write to the I2C register in given head's monitor
//i2cWrite(I2C_ADDR_MON_BASE_H0 + head*monBaseSpacing + MON_THERM_EN_OFFSET, 1, pTestBench);
//nsleepSim(200);
//// Read the count
//uint32_t count = pTestBench->pThermRstCount->GetThermRstCount();
//if (count != 7)
//{
//VPrint("**ERROR 200: bad thermal trip reset count for head %d. (got 0x%02d, exp 0x%02d)\n", head, count, 7);
//error |= 1;
//}
//}
//return error;
//}
// --------------------------------------------------
// Thermistor fault trip reset level test
// --------------------------------------------------
//uint32_t runTest::therm_trip_reset_level_test(CTestAuto* pTestBench)
//{
//int error = 0;
//uint32_t status = 0;
//uint32_t target = 0;
//VPrint(" Starting thermistor fault trip reset level set tests\n");
//for (int head = 0; head < 4; head++)
//{
//target = 0;
//status = pTestBench->pThermTripResetStatus->GetThermTripResetStatus();
//if (status != target)
//{
//VPrint("**ERROR 700: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, target);
//error |= 1;
//}
//uint32_t monBaseSpacing = I2C_ADDR_MON_BASE_H1 - I2C_ADDR_MON_BASE_H0;
//// Write to the I2C register in given head's monitor
//// set it to 1
//target = 1;
//i2cWrite(I2C_ADDR_MON_BASE_H0 + head*monBaseSpacing + MON_THERM_TRIP_RESET_LEVEL_OFFSET, target, pTestBench);
//nsleepSim(200);
//// Read the status
//status = pTestBench->pThermTripResetStatus->GetThermTripResetStatus();
//if (target != status)
//{
//VPrint("**ERROR 701: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, target);
//error |= 1;
//}
//// Write to the I2C register in given head's monitor
//// set it to 1 again
//target = 1;
//i2cWrite(I2C_ADDR_MON_BASE_H0 + head*monBaseSpacing + MON_THERM_TRIP_RESET_LEVEL_OFFSET, target, pTestBench);
//nsleepSim(200);
//// Read the status
//status = pTestBench->pThermTripResetStatus->GetThermTripResetStatus();
//if (target != status)
//{
//VPrint("**ERROR 702: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, target);
//error |= 1;
//}
//// Write to the I2C register in given head's monitor
//// set it to 0
//target = 0;
//i2cWrite(I2C_ADDR_MON_BASE_H0 + head*monBaseSpacing + MON_THERM_TRIP_RESET_LEVEL_OFFSET, target, pTestBench);
//nsleepSim(200);
//// Read the status
//status = pTestBench->pThermTripResetStatus->GetThermTripResetStatus();
//if (target != status)
//{
//VPrint("**ERROR 703: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, target);
//error |= 1;
//}
//// Write to the I2C register in given head's monitor
//// set it to 0 again
//target = 0;
//i2cWrite(I2C_ADDR_MON_BASE_H0 + head*monBaseSpacing + MON_THERM_TRIP_RESET_LEVEL_OFFSET, target, pTestBench);
//nsleepSim(200);
//// Read the status
//status = pTestBench->pThermTripResetStatus->GetThermTripResetStatus();
//if (target != status)
//{
//VPrint("**ERROR 704: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, target);
//error |= 1;
//}
//}
//return error;
//}
// -------------------------------------------------
// Shutdown enable delay test
// -------------------------------------------------
//uint32_t runTest::shutdn_en_dly_test (CTestAuto* pTestBench)
//{
//int error = 0;
//uint32_t status;
//uint32_t data;
//VPrint(" Starting shutdown trip enable delay tests\n");
//// Disable all shutdowns
//for (int head = 0; head < 4; head++)
//{
//i2cWrite(I2C_ADDR_SHUT_CLR0 + head, 0xff, pTestBench);
//}
//// Set a 1ms delay
//uint32_t delay1msTicks = 100000;
//i2cWrite(I2C_ADDR_SHUT_DLY_LO, (delay1msTicks >> 0) & 0xff, pTestBench);
//i2cWrite(I2C_ADDR_SHUT_DLY_MID, (delay1msTicks >> 8) & 0xff, pTestBench);
//i2cWrite(I2C_ADDR_SHUT_DLY_HI, (delay1msTicks >> 16) & 0xff, pTestBench);
//// Set a new shutdown enable
//i2cWrite(I2C_ADDR_SHUT_EN_H0, 1, pTestBench);
//// Check no shutdown
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 600: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", 0, status, 0);
//error |= 1;
//}
//// Set go
//i2cWrite(I2C_ADDR_SHUT_GO, 1, pTestBench);
//// Wait for 0.5ms
//usleepSim(500);
//// Set a trip on the input
//pTestBench->pTrip->SetShutdnH0(1);
//// check no shutdown
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 601: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", 0, status, 0);
//error |= 1;
//}
//// Wait for 0.5ms
//usleepSim(500);
//// Set a trip on the input
//pTestBench->pTrip->SetShutdnH0(1);
//// Check for shutdown
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status == 0)
//{
//VPrint("**ERROR 602: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d, trip 0x%x)\n", 0, status, 1, 0);
//error |= 1;
//}
//// Clear enable
//i2cWrite(I2C_ADDR_SHUT_CLR0, 1, pTestBench);
//// Clear shutdown status
//i2cWrite(I2C_ADDR_MON_BASE_H0 + MON_SHUTDN_CLR_OFFSET, 1, pTestBench);
//// Set a trip on the input
//pTestBench->pTrip->SetShutdnH0(1);
//// Check no shutdown
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 603: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", 0, status, 0);
//error |= 1;
//}
//// Clear the new shutdown enable
//i2cWrite(I2C_ADDR_SHUT_EN_H0, 0, pTestBench);
//// Set go
//i2cWrite(I2C_ADDR_SHUT_GO, 1, pTestBench);
//// Wait for > 1 ms
//usleepSim(1100);
//// Set again the trip input
//pTestBench->pTrip->SetShutdnH0(1);
//// Check no shutdown.
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 604: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", 0, status, 0);
//error |= 1;
//}
//// Set delay to 0 once more
//i2cWrite(I2C_ADDR_SHUT_DLY_LO, 0, pTestBench);
//i2cWrite(I2C_ADDR_SHUT_DLY_MID, 0, pTestBench);
//i2cWrite(I2C_ADDR_SHUT_DLY_HI, 0, pTestBench);
//return error;
//}
// -------------------------------------------------
// Shutdown trip test
// -------------------------------------------------
////uint32_t runTest::shutdn_trip_test (CTestAuto* pTestBench)
//{
//int error = 0;
//uint32_t status;
//uint32_t data;
//VPrint(" Starting shutdown trip tests\n");
//uint32_t monBaseSpacing = I2C_ADDR_MON_BASE_H1 - I2C_ADDR_MON_BASE_H0;
//// Mask all shutdown trips over I2C
//for (int head = 0; head < 4; head++)
//{
//i2cWrite(I2C_ADDR_SHUT_CLR0 + head, 0xff, pTestBench);
//}
//// run through each trip
//for (int head = 0; head < NUM_HEADS; head++)
//{
//for (int trip = 0; trip < TRIPS_PER_HEAD; trip++)
//{
//// Set TB trip bit
//switch(head)
//{
//case 0: pTestBench->pTrip->SetShutdnH0(1 << trip); break;
//case 1: pTestBench->pTrip->SetShutdnH1(1 << trip); break;
//case 2: pTestBench->pTrip->SetShutdnH2(1 << trip); break;
//case 3: pTestBench->pTrip->SetShutdnH3(1 << trip); break;
//default: null; break;
//}
//// Check no shutdown in TB status
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 300: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, 0);
//error |= 1;
//}
//// Check no shutdown in I2C registers for all heads
//for (int idx = 0; idx < NUM_HEADS; idx++)
//{
//i2cRead(I2C_ADDR_MON_BASE_H0 + monBaseSpacing*idx + MON_SHUTDN_TRIP_OFFSET, data, pTestBench);
//uint32_t exp = 0;
//if (data != exp)
//{
//VPrint("**ERROR 301: bad i2c trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, data, exp);
//error |= 1;
//}
//}
//// Enable trip bit for this head
//i2cWrite(I2C_ADDR_SHUT_EN_H0 + head, (1 << (trip+1)) - 1, pTestBench);
//i2cWrite(I2C_ADDR_SHUT_GO, 1, pTestBench);
//// Set TB trip bit
//switch(head)
//{
//case 0: pTestBench->pTrip->SetShutdnH0(1 << trip); break;
//case 1: pTestBench->pTrip->SetShutdnH1(1 << trip); break;
//case 2: pTestBench->pTrip->SetShutdnH2(1 << trip); break;
//case 3: pTestBench->pTrip->SetShutdnH3(1 << trip); break;
//default: null; break;
//}
//// Check shutdown in TB status is set
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status == 0)
//{
//VPrint("**ERROR 302: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d, trip 0x%x)\n", head, status, 1, trip);
//error |= 1;
//}
//// Check shutdown statuses over I2C with only expected bit set for given head
//for (int idx = 0; idx < NUM_HEADS; idx++)
//{
//// Check no shutdown in I2C registers for all heads
//i2cRead(I2C_ADDR_MON_BASE_H0 + monBaseSpacing*idx + MON_SHUTDN_TRIP_OFFSET, data, pTestBench);
//uint32_t exp = (head == idx) ? (1 << trip) : 0;
//if (data != exp)
//{
//VPrint("**ERROR 303: bad i2c trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, data, exp);
//error |= 1;
//}
//}
//// Clear shutdown over I2C
//i2cWrite(I2C_ADDR_MON_BASE_H0 + monBaseSpacing*head + MON_SHUTDN_CLR_OFFSET, (1 << trip), pTestBench);
//// Check no shutdown in TB status
//status = pTestBench->pShutdownStatus->GetShutdownStatus();
//if (status)
//{
//VPrint("**ERROR 304: bad test bench trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, status, 0);
//error |= 1;
//}
//// Check no shutdown in I2C registers for all heads
//for (int idx = 0; idx < NUM_HEADS; idx++)
//{
//i2cRead(I2C_ADDR_MON_BASE_H0 + monBaseSpacing*idx + MON_SHUTDN_TRIP_OFFSET, data, pTestBench);
//uint32_t exp = 0;
//if (data != exp)
//{
//VPrint("**ERROR 305: bad i2c trip status for head %d. (got 0x%02d, exp 0x%02d)\n", head, data, exp);
//error |= 1;
//}
//}
//}
//}
//return error;
//}
// -------------------------------------------------
// Thermal trip test
// -------------------------------------------------
//uint32_t runTest::therm_trip_test(CTestAuto* pTestBench)
//{
//int error = 0;
//uint32_t data;
//VPrint(" Starting thermal trip tests\n");
//// Test the head thermal trips
//for (int head = 0; head < NUM_HEADS; head++)
//{
//for (int bit = 0; bit < 3; bit++)
//{
//// Set therm value in TB for given head
//switch(head)
//{
//case 0: pTestBench->pTrip->SetThermH0(1 << bit); break;
//case 1: pTestBench->pTrip->SetThermH1(1 << bit); break;
//case 2: pTestBench->pTrip->SetThermH2(1 << bit); break;
//case 3: pTestBench->pTrip->SetThermH3(1 << bit); break;
//default: null; break;
//}
//uint32_t monBaseSpacing = I2C_ADDR_MON_BASE_H1 - I2C_ADDR_MON_BASE_H0;
//// Read back the value over I2C
//i2cRead(I2C_ADDR_MON_BASE_H0 + monBaseSpacing*head + MON_THERM_TRIP_OFFSET, data, pTestBench);
//if (data != (1 << bit))
//{
//VPrint("**ERROR 100: bad head thermal trip data for head %d. (got 0x%02x, exp 0x%02x)\n", head, data, (1 << bit));
//error |= 1;
//}
//// Set therm value back to 0 in TB for given head
//switch(head)
//{
//case 0: pTestBench->pTrip->SetThermH0(0); break;
//case 1: pTestBench->pTrip->SetThermH1(0); break;
//case 2: pTestBench->pTrip->SetThermH2(0); break;
//case 3: pTestBench->pTrip->SetThermH3(0); break;
//default: null; break;
//}
//}
//}
//return error;
//}
// -------------------------------------------------
// I2C test
// -------------------------------------------------
uint32_t runTest::i2c_if_test(CTestAuto* pTestBench)
{
int error = 0;
uint32_t data;
VPrint(" Starting i2c interface tests\n");
// Write to scratch register 0
i2cWrite(I2C_ADDR_SCRATCH0, TEST_BYTE0, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 000: Bad ACK status after data write\n");
error = 1;
}
// Write to scratch register 1
i2cWrite(I2C_ADDR_SCRATCH1, TEST_BYTE1, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 001: Bad ACK status after data write\n");
error = 1;
}
// Read scratch register 0 value back
i2cRead(I2C_ADDR_SCRATCH0, data, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 002: Bad ACK status after data read\n");
error = 1;
}
if (data != TEST_BYTE0)
{
VPrint("**ERROR 003 : bad byte read from scratch 0 register (got 0x%02x exp 0x%02x)\n", data, TEST_BYTE0);
error = 1;
}
// Read scratch register 1 back
i2cRead(I2C_ADDR_SCRATCH1, data, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 003: Bad ACK status after data read\n");
error = 1;
}
if (data != TEST_BYTE1)
{
VPrint("**ERROR 004 : bad byte read from scratch 1 register (got 0x%02x exp 0x%02x)\n", data, TEST_BYTE1);
error = 1;
}
// Read IP_ID Value
i2cRead(I2C_ADDR_IP_ID, data, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 005: Bad ACK status after data read\n");
error = 1;
}
if (data != 0x29)
{
VPrint("**ERROR 006 : Bad IP ID read from register (got 0x%02x exp 0x%02x)\n", data, 0x29);
error = 1;
}
// Read IP_VER Value
i2cRead(I2C_ADDR_IP_VER, data, pTestBench);
if (pTestBench->pI2cStatus->GetAckError() != 0)
{
VPrint("**ERROR 007: Bad ACK status after data read\n");
error = 1;
}
if (data != 0x02)
{
VPrint("**ERROR 008 : Bad IP VER read from register (got 0x%02x exp 0x%02x)\n", data, 0x01);
error = 1;
}
// Set the debug LEDs to CPU control and set a value
i2cWrite(I2C_ADDR_DBG_LED, (TEST_BYTE2 << 1) | 1, pTestBench);
// Read the TB LED status
data = pTestBench->pDbgLedStatus->GetDbgLedStatus();
if (data != TEST_BYTE2)
{
VPrint("**ERROR 009 : bad debug LED status (got 0x%02x exp 0x%02x)\n", data, TEST_BYTE2);
error = 1;
}
return error;
}
// --------------------------------------------------
// I2C write method
// --------------------------------------------------
uint32_t runTest::i2cWrite (uint32_t hmb_addr, uint32_t data, CTestAuto* pTestBench)
{
csrWriteMem(CSR_TEST_I2C_MASTER | (SLAVE_I2C_ADDR << 2), ((hmb_addr & 0xff00) >> 8) | ((hmb_addr & 0xff) << 8) | ((data & 0xff) << 16));
// Wait until we've seen busy go high to indicate transaction excepted
while (pTestBench->pI2cStatus->GetBusy() == 0)
usleepSim(1);
// Wait until we've seen busy go low at the end of the transaction
while (pTestBench->pI2cStatus->GetBusy() == 1)
usleepSim(1);
return 0;
}
// --------------------------------------------------
// I2C read method
// --------------------------------------------------
uint32_t runTest::i2cRead(uint32_t hmb_addr, uint32_t &data, CTestAuto* pTestBench)
{
csrWriteMem(CSR_TEST_I2C_MASTER | ((CMD_READ_OFFSET | SLAVE_I2C_ADDR) << 2), ((hmb_addr & 0xff00) >> 8) | ((hmb_addr & 0xff) << 8));
// Wait until we've seen busy go high to indicate transaction excepted
while (pTestBench->pI2cStatus->GetBusy() == 0)
usleepSim(1);
// Wait until we've seen busy go low at the end of the transaction
while (pTestBench->pI2cStatus->GetBusy() == 1)
usleepSim(1);
uint32_t rd_data;
csrReadMem(CSR_TEST_I2C_MASTER | ((CMD_READ_OFFSET | SLAVE_I2C_ADDR) << 2), &rd_data);
data = rd_data;
return 0;
}

View file

@ -0,0 +1,58 @@
/**************************************************************/
/* runTest.h Date: 2018/08/9 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#ifndef _READTEST_H_
#define _READTEST_H_
#ifdef HDL_SIM
#include "VUserMain0.h"
// Memory model API has C linkage functions
extern "C" {
#include "mem_model.h"
#include "VUser.h"
}
#else
#error No co-simulation support as yet
#endif
#include "runTestLocal.h"
class runTest
{
public:
// Constructor
runTest()
{
};
// Entry method for running the tests
int start (int node);
private:
uint32_t i2c_if_test (CTestAuto* pTestBench);
//uint32_t therm_trip_test (CTestAuto* pTestBench);
//uint32_t therm_trip_rst_test (CTestAuto* pTestBench);
//uint32_t therm_trip_reset_level_test(CTestAuto* pTestBench);
//uint32_t shutdn_trip_test (CTestAuto* pTestBench);
//uint32_t shutdn_en_dly_test (CTestAuto* pTestBench);
//uint32_t watchdog_test (CTestAuto* pTestBench);
//uint32_t serdes_test (CTestAuto* pTestBench);
uint32_t i2cWrite (uint32_t addr, uint32_t data, CTestAuto* pTestBench);
uint32_t i2cRead(uint32_t hmb_addr, uint32_t &data, CTestAuto* pTestBench);
bool testLvds;
uint32_t clkFreqMHz;
uint32_t i2cFreqKHz;
};
#endif

View file

@ -0,0 +1,65 @@
/**************************************************************/
/* runTest.h Date: 2018/08/9 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#ifndef _READTEST_LOCAL_H_
#define _READTEST_LOCAL_H_
// Include top level HAL header
#include "hal/CTestAuto.h"
#include "hal/hmb_fpga.h"
#define CMD_READ_OFFSET 0x80
#define SLAVE_I2C_ADDR 0x39
#define TEST_BYTE0 0x55
#define TEST_BYTE1 0xaa
#define TEST_BYTE2 0x13
#define NUM_HEADS 4
#define TRIPS_PER_HEAD 5
#define TOTAL_NUM_TRIPS (NUM_HEADS * TRIPS_PER_HEAD)
#define I2C_ADDR_SCRATCH0 (CSR_HMB_FPGA_SCRATCH0/4)
#define I2C_ADDR_SCRATCH1 (CSR_HMB_FPGA_SCRATCH1/4)
#define I2C_ADDR_IP_ID (CSR_HMB_FPGA_IP_ID/4)
#define I2C_ADDR_IP_VER (CSR_HMB_FPGA_IP_VER/4)
#define I2C_ADDR_DBG_LED (CSR_HMB_FPGA_CPU_DBG_LED/4)
#define I2C_ADDR_SHUT_EN_H0 (CSR_HMB_FPGA_SHUTDN_EN0/4)
#define I2C_ADDR_SHUT_EN_H1 (CSR_HMB_FPGA_SHUTDN_EN1/4)
#define I2C_ADDR_SHUT_EN_H2 (CSR_HMB_FPGA_SHUTDN_EN2/4)
#define I2C_ADDR_SHUT_EN_H3 (CSR_HMB_FPGA_SHUTDN_EN3/4)
#define I2C_ADDR_SHUT_DLY_LO (CSR_HMB_FPGA_SHUTDN_DLY_LO/4)
#define I2C_ADDR_SHUT_DLY_MID (CSR_HMB_FPGA_SHUTDN_DLY_MID/4)
#define I2C_ADDR_SHUT_DLY_HI (CSR_HMB_FPGA_SHUTDN_DLY_HI/4)
#define I2C_ADDR_SHUT_GO (CSR_HMB_FPGA_SHUTDN_GO/4)
#define I2C_ADDR_WD_CTRL (CSR_HMB_FPGA_WD_CTRL/4)
#define I2C_ADDR_WD_STATUS (CSR_HMB_FPGA_WD_STATUS/4)
#define I2C_ADDR_SHUT_CLR0 (CSR_HMB_FPGA_SHUTDN_CLR0/4)
#define I2C_ADDR_SHUT_CLR1 (CSR_HMB_FPGA_SHUTDN_CLR1/4)
#define I2C_ADDR_SHUT_CLR2 (CSR_HMB_FPGA_SHUTDN_CLR2/4)
#define I2C_ADDR_SHUT_CLR3 (CSR_HMB_FPGA_SHUTDN_CLR3/4)
#define WD_CLR CSR_HMB_FPGA_WD_CTRL_CLR_MASK
#define WD_EN CSR_HMB_FPGA_WD_CTRL_EN_MASK
#define WD_PERIOD_LO_BIT CSR_HMB_FPGA_WD_CTRL_PERIOD
#define WD_PERIOD_MASK CSR_HMB_FPGA_WD_CTRL_PERIOD_MASK;
#define I2C_ADDR_MON_BASE_H0 (CSR_HMB_FPGA_MONITOR_0/4)
#define I2C_ADDR_MON_BASE_H1 (CSR_HMB_FPGA_MONITOR_1/4)
#define I2C_ADDR_MON_BASE_H2 (CSR_HMB_FPGA_MONITOR_2/4)
#define I2C_ADDR_MON_BASE_H3 (CSR_HMB_FPGA_MONITOR_3/4)
#define MON_THERM_EN_OFFSET 0x0000
#define MON_THERM_TRIP_OFFSET 0x0001
#define MON_SHUTDN_CLR_OFFSET 0x0002
#define MON_SHUTDN_TRIP_OFFSET 0x0003
#define MON_THERM_TRIP_RESET_LEVEL_OFFSET 0X0004
#define WD_DEFAULT_PERIOD (0xF << WD_PERIOD_LO_BIT)
#endif

1
firmware/make el-gip.bat Normal file
View file

@ -0,0 +1 @@
mklink /j generic_ip d:\git\EL-GENERIC-IP\generic_ip

View file

@ -1,8 +1,9 @@
[{
"ip_name" : "print_ctrl",
"bus" : "csr",
"addr_hi_bit" : "9",
"addr_lo_bit" : "6",
"addr_hi_bit" : "10",
"addr_lo_bit" : "7",
"addr_width" : "5",
"description" : "This block is the print controller for the GMA SOM board soft IP",
"notes" : "The print_ctrl block contains local registers for CPU access to status, and for CPU control and instigation of function, some of which is just for the purposes of test and debug. The CSR_PRINT_CTRL_SEQ_STATUS register has six fields of 4 bits each (for each of the four heads) with bits for the wave and print data sequence busy statuses, and for the data core empty statuses (i.e. no data in the pixel buffer). In addition, there are three error cases for over- and under-runs and double 'droppy' detetction. The CSR_PRINT_CTRL_CONTROL register provides the ability for the CPU to configure the print system. The CHAN_EN field is a master enable for the data core, and the BPP_MODE sets the bits-per-pixel, with valid values for GMA of 1, 2 or 3. The system supports both the GMA3305300 and the GMA9905300, and the DATA_WIDTH field setting configures the mode by specifying either 6 or 18 (for the GMA3305300 and the GMA9905300 respectively). The block is designed to be generic so all values from 1 to 18 are supported, but no product can yet utilise other values. Some test and debug features are provided in the registers, with the CPU_GL_MAP bit of the CSR_PRINT_CTRL_CONTROL register enabling the overriding of the GL map value of the logic, with the values set in the CSR_PRINT_CTRL_CPU_GL_MAP register. This register has four fields of 8 bits---one for each head. In addition, the CPU can instigate a wave sequence start by writing a 1 to the CSR_PRINT_CTRL_CPU_WAVE_SEQ_START register. The sequence start addresses are specified in the 4 registers CSR_PRINT_CTRL_CPU_WAVE_SEQ_ADDRx, where x is 0 to 3. The instigation of a start request to the data core can also be controlled from the CPU by writing a 1 to the CSR_PRINT_CTRL_CPU_DATA_START register. Required delays can be specified in the CSR_PRINT_CTRL_CPU_START_DLY register, with 4 fields of 8 bits---one for each head. The delay is limited to 8 bits, even though the delay queue has more (currently 10 bits), but the full range is not felt to be a test or debug requirement. Data can also be pushed into the pixel buffers from the CPU by setting the CPU_PX_SEL field of the CSR_PRINT_CTRL_CONTROL to select which buffer to update, and then writing to the CSR_PRINT_CTRL_CPU_PUSH_PX_BUF for each word. Note that it is important to have set the BPP mode to be used before attempting to write to the pixel buffer from the CPU as the correct unpacking of data is a function of this.",
"sub_blocks" : {
@ -14,27 +15,27 @@
"print_unit:b" : {
"instance" : "1",
"process" : "enabled",
"offset" : "0x040"
"offset" : "0x080"
},
"print_unit:c" : {
"instance" : "2",
"process" : "enabled",
"offset" : "0x080"
"offset" : "0x100"
},
"print_unit:d" : {
"instance" : "3",
"process" : "enabled",
"offset" : "0x0c0"
"offset" : "0x180"
},
"local" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x100"
"offset" : "0x200"
},
"print_streamer" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x140"
"offset" : "0x280"
}
},
"registers" : {
@ -54,7 +55,7 @@
"bit_len" : "8",
"reset" : "0x04",
"description" : "Manufacturer number"
},
"reserved" : {
"type" : "rsv",
@ -63,7 +64,7 @@
}
}
},
"ip_ver" : {
"address" : "1",
"width" : "32",
@ -80,7 +81,7 @@
"bit_len" : "8",
"reset" : "0x00",
"description" : "Major number"
},
"reserved" : {
"type" : "rsv",
@ -126,7 +127,7 @@
},
"seq_status" : {
"address" : "7",
"width" : "28",
"width" : "32",
"description" : "Print unit sequencer statuses",
"fields" : {
"wave_seq_busy" : {
@ -170,12 +171,18 @@
"bit_len" : "4",
"reset" : "0x00",
"description" : "Print unit data core double 'droppy' error condition detected"
},
"overlap_error" : {
"type" : "r",
"bit_len" : "4",
"reset" : "0x00",
"description" : "Print unit data core merge overlap error condition detected"
}
}
},
"control" : {
"address" : "8",
"width" : "29",
"width" : "30",
"description" : "Data core control register",
"fields" : {
"chan_en" : {
@ -237,6 +244,12 @@
"reset" : "0",
"description" : "Enable power-up/down from CPU for test"
},
"en_dual_data_path" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable PD inline merge dual data paths, if supported"
},
"cpu_adc_meas" : {
"type" : "w0",
"bit_len" : "1",
@ -339,7 +352,7 @@
"last" : {
"type" : "w",
"bit_len" : "4",
"reset" : "0x0",
"reset" : "0xf",
"description" : "Sets a flag indicating CPU start pulse is the first in a (potentially) multi-wave sequence."
}
}
@ -353,10 +366,29 @@
},
"cpu_fire_req" : {
"address" : "13",
"width" : "8",
"type" : "wp",
"reset" : "0",
"description" : "Send a fire request with the written fire request data"
"width" : "13",
"description" : "Send a fire request with the written fire request data",
"fields" : {
"start_merge" : {
"type" : "wp",
"bit_len" : "1",
"reset" : "0",
"description" : "Mark fire request as a start_merge request"
},
"mask" : {
"type" : "wp",
"bit_len" : "4",
"reset" : "0",
"description" : "Mask fire requests to heads (1 = disable)"
},
"seq_addr" : {
"type" : "wp",
"bit_len" : "8",
"reset" : "0",
"description" : "Address for Print Sequencer to Start At"
}
}
},
"dac_0v_value" : {
"address" : "14",
@ -395,9 +427,167 @@
"description" : "Data core BPP mode control for head0"
}
}
},
"cpu_start_seq" : {
"address" : "16",
"width" : "12",
"description" : "Start print unit sequencers under CPU control",
"fields" : {
"go" : {
"type" : "wp",
"bit_len" : "4",
"reset" : "0",
"description" : "Go bits for individual print unit sequencers"
},
"address" : {
"type" : "wp",
"bit_len" : "8",
"reset" : "0",
"description" : "Start address for sequence"
}
}
},
"diag_nonzero" : {
"address" : "17",
"width" : "32",
"description" : "Diagnostic to detect printing ones",
"fields" : {
"head0" : {
"type" : "r",
"bit_len" : "7",
"reset" : "0",
"description" : "Number of Non-Zero pixels. Holds at 127 max until cleared"
},
"head1" : {
"type" : "r",
"bit_len" : "7",
"reset" : "0",
"description" : "Number of Non-Zero pixels. Holds at 127 max until cleared"
},
"head2" : {
"type" : "r",
"bit_len" : "7",
"reset" : "0",
"description" : "Number of Non-Zero pixels. Holds at 127 max until cleared"
},
"head3" : {
"type" : "r",
"bit_len" : "7",
"reset" : "0",
"description" : "Number of Non-Zero pixels. Holds at 127 max until cleared"
},
"clr" : {
"type" : "w0",
"bit_len" : "4",
"reset" : "0",
"description" : "Clear non zero bits"
}
}
},
"debug_wr_if_ctrl" : {
"address" : "18",
"width" : "7",
"description" : "Memory write interface control",
"fields": {
"enable" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Enable Operation"
},
"clr" : {
"type" : "w0",
"bit_len" : "1",
"reset" : "0",
"description" : "Clear interface"
},
"update_addr" : {
"type" : "w0",
"bit_len" : "1",
"reset" : "0",
"description" : "Update DMA addresses"
},
"smpl_wr_addr" : {
"type" : "w0",
"bit_len" : "1",
"reset" : "0",
"description" : "Sample DMA write address"
},
"trig_underrun" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "When set, the event logger will stop when an underrun is detected. The triggered bit will be set"
},
"trig_dbl_drop" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "When set, the event logger will stop when a double drop is detected. The triggered bit will be set"
},
"trig_now" : {
"type" : "w0",
"bit_len" : "1",
"reset" : "0",
"description" : "Set to fake a trigger event"
}
}
},
"debug_wr_if_base_addr" : {
"address" : "19",
"width" : "32",
"type" : "w",
"reset" : "0x20000000",
"description" : "Byte address of DMA circular buffer base"
},
"debug_wr_if_end_addr" : {
"address" : "20",
"width" : "32",
"type" : "w",
"reset" : "0x2000ffff",
"description" : "Byte address of DMA circular buffer end"
},
"debug_wr_if_status" : {
"address" : "21",
"width" : "3",
"description" : "Memory write interface status",
"fields": {
"overflow" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Overfow error (sticky). Events lost due to FIFO overflow"
},
"write_busy" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Data is in transit to memory. Wait for this to be clear before reading near the write head"
},
"triggered" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "When 1, the event logging has stopped due to a trigger event (or a trigger now) occuring"
}
}
},
"debug_wr_if_wr_addr" : {
"address" : "22",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Sampled byte address of next memory write"
},
"debug_wr_if_bytes_written" : {
"address" : "23",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Number of bytes written since last clr. All 1's indicates greater than 4G"
}
}
},
{
"ip_name" : "print_ctrl",

View file

@ -29,16 +29,17 @@
--! @b Language build standard requirements:
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2018 Global Inkjet Systems
--! @date 2018-1-10
--! @author Dave Steele
--! @copyright (c) 2024 Global Inkjet Systems
--! @date 2024-1-29
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.sg1024_pkg.all;
entity print_ctrl is
generic(
@ -48,10 +49,14 @@ entity print_ctrl is
MAX_HEADS : natural range 1 to 4 := 4;
NUM_HEADS : natural range 1 to 16 := 4;
MAX_OP_WIDTH : natural range 1 to 48 := 48;
NUM_CHANS : natural range 1 to 8 := 2;
SHIFT_DEPTH : integer range 1 to 1024 := 128;
PCLK_CLK_RATIO : integer range 1 to 32 := 8;
SLIM : boolean := true;
DYNAMIC_COMBINE : boolean := true
DYNAMIC_COMBINE : boolean := true;
NO_ZERO_GAP : boolean := true;
STREAMER_LOGGER : boolean := true;
EN_PEEK : boolean := false
);
port(
@ -59,7 +64,7 @@ entity print_ctrl is
clk_x2 : in std_logic;
rst_n : in std_logic;
avs_csr_address : in std_logic_vector(9 downto 0);
avs_csr_address : in std_logic_vector(10 downto 0);
avs_csr_write : in std_logic;
avs_csr_writedata : in std_logic_vector(31 downto 0);
avs_csr_read : in std_logic;
@ -71,13 +76,6 @@ entity print_ctrl is
avs_seq_read : in std_logic;
avs_seq_readdata : out std_logic_vector(31 downto 0);
avm_rx_waitrequest : out std_logic;
avm_rx_burstcount : in std_logic_vector(11 downto 0);
avm_rx_address : in std_logic_vector(31 downto 0);
avm_rx_read : in std_logic;
avm_rx_readdata : out std_logic_vector(31 downto 0);
avm_rx_readdatavalid : out std_logic;
--AXI write address bus
axm_awaddr : out std_logic_vector(31 downto 0);
axm_awprot : out std_logic_vector(2 downto 0);
@ -110,9 +108,19 @@ entity print_ctrl is
axm_rvalid : in std_logic; --slave data valid
axm_rready : out std_logic; --master ready to accept
fire_req : in std_logic_vector(NUM_HEADS - 1 downto 0);
-- Avalon Master burst write interface for FPGA configuration block
avm_tx_waitrequest : in std_logic;
avm_tx_burstcount : out std_logic_vector(11 downto 0) := (others => '0');
avm_tx_address : out std_logic_vector(31 downto 0) := (others => '0');
avm_tx_write : out std_logic := '0';
avm_tx_writedata : out std_logic_vector(63 downto 0) := (others => '0');
avm_tx_last : out std_logic;
fire_req : in fpm_vec_t(0 to NUM_HEADS-1);
fire_req_start_merge : in fpm_vec_t(0 to NUM_HEADS-1);
fire_data : in std_logic_vector(7 downto 0);
px_buf_ch_nactive : out std_logic_vector((NUM_HEADS*NUM_CHANS)-1 downto 0);
stm8_trigger_rx : out std_logic;
sig_seq_force_dacs_0v : in std_logic;
@ -130,12 +138,17 @@ entity print_ctrl is
en_test_fp_logic : out std_logic;
en_test_pwr_ctrl : out std_logic;
ps_wr : out std_logic;
ps_wr_data : out std_logic_vector(31 downto 0);
ps_rdy : in std_logic;
gma99 : out std_logic;
pof_rx_debug : in std_logic_vector(31 downto 0);
diag_peek_sel : in std_logic_vector( 3 downto 0);
diag_peek_addr : in std_logic_vector(31 downto 0);
diag_peek_data : out std_logic_vector(31 downto 0);
diag_peek_rdptr : out std_logic_vector( 7 downto 0);
diag_peek_wrptr : out std_logic_vector( 7 downto 0);
diag_peek_wdata : in std_logic_vector(31 downto 0);
diag_peek_wr : in std_logic;
diag_word_count_comb : out std_logic_vector(31 downto 0);
dbg_port : out std_logic_vector(7 downto 0)
@ -154,12 +167,13 @@ architecture rtl of print_ctrl is
type px_data_t is array (0 to MAX_HEADS - 1) of std_logic_vector(31 downto 0);
type bpp_vec_t is array (0 to MAX_HEADS - 1) of std_logic_vector(3 downto 0);
type diag_wc_vec_t is array (0 to MAX_HEADS - 1) of std_logic_vector(6 downto 0);
type print_vec_t is array (natural range <>) of std_logic_vector;
constant ZERO : std_logic_vector(47 downto 0) := 48x"0";
signal stm8_trigger_rx_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal wave_seq_busy : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_seq_busy : std_logic_vector(MAX_HEADS - 1 downto 0);
signal seq_dac_data : dac_vec_t;
signal seq_dac_data_int : dac_vec_t;
@ -192,54 +206,106 @@ architecture rtl of print_ctrl is
signal underrun : std_logic_vector(MAX_HEADS - 1 downto 0);
signal overrun : std_logic_vector(MAX_HEADS - 1 downto 0);
signal dbl_drop : std_logic_vector(MAX_HEADS - 1 downto 0);
signal overlap_error : std_logic_vector(MAX_HEADS-1 downto 0);
signal fp_drop : std_logic_vector(MAX_HEADS - 1 downto 0);
signal clear_buffer : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_gl_map_en : std_logic;
signal cpu_gl_map_head : remap_t;
signal cpu_start_dly_head : data_dly_t;
signal cpu_data_start : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_data_start_first : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_data_start_last : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_adc_meas : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_gl_map_en : std_logic;
signal cpu_gl_map_head : remap_t;
signal cpu_start_dly_head : data_dly_t;
signal cpu_data_start : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_data_start_first : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_data_start_last : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_adc_meas : std_logic_vector(MAX_HEADS - 1 downto 0);
signal control_cpu_px_sel : std_logic_vector(1 downto 0);
signal cpu_push_px_buf_pulse : std_logic;
signal cpu_push_px_buf : std_logic_vector(31 downto 0);
signal cpu_px_sel : std_logic_vector( 1 downto 0);
signal cpu_push_px_buf_pulse : std_logic;
signal cpu_push_px_buf : std_logic_vector(31 downto 0);
signal pixel_buf_wr_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal pixel_buf_wr_data_int : px_data_t;
signal pixel_buf_rdy : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_fire_req_mask : std_logic_vector(MAX_HEADS-1 downto 0);
signal cpu_fire_req_pulse : std_logic;
signal cpu_fire_req_start_merge : std_logic;
signal cpu_fire_req_data : std_logic_vector(7 downto 0);
signal pixel_buf_wr : std_logic_vector(MAX_HEADS - 1 downto 0);
signal cpu_start_seq_pulse : std_logic;
signal cpu_start_seq_go : std_logic_vector( 3 downto 0);
signal cpu_start_seq_address : std_logic_vector( 7 downto 0);
signal fire_req_in0 : std_logic_vector(NUM_HEADS-1 downto 0);
signal fire_req_start_merge_in0 : std_logic_vector(NUM_HEADS-1 downto 0);
signal fire_req_int : std_logic_vector(NUM_HEADS-1 downto 0);
signal fire_req_start_merge_int : std_logic_vector(NUM_HEADS-1 downto 0);
signal cpu_fire_req_start_merge_plse : std_logic;
signal fire_req_data_int : std_logic_vector( 7 downto 0);
signal print_seq_busy : std_logic_vector(MAX_HEADS-1 downto 0);
signal pixel_buf_wr_int : std_logic_vector(NUM_CHANS*MAX_HEADS - 1 downto 0);
signal pixel_buf_wr_data_int : print_vec_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal pixel_buf_rdy : std_logic_vector(NUM_CHANS*MAX_HEADS - 1 downto 0);
signal pixel_buf_last_word : std_logic;
signal pixel_buf_wr : std_logic_vector(NUM_CHANS*MAX_HEADS - 1 downto 0);
signal pixel_buf_wr_data : std_logic_vector(31 downto 0);
signal cpu_fire_req_pulse : std_logic;
signal cpu_fire_req : std_logic_vector(7 downto 0);
signal fire_req_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal fire_req_data_int : std_logic_vector(7 downto 0);
signal fire_req_edge : std_logic_vector(MAX_HEADS - 1 downto 0);
signal fire_req_dly : std_logic_vector(MAX_HEADS - 1 downto 0);
signal diag_word_count : print_vec_t(0 to MAX_HEADS-1)( 6 downto 0);
signal diag_peek_data_int : print_vec_t(0 to MAX_HEADS-1)(31 downto 0);
signal diag_peek_rdptr_int : print_vec_t(0 to MAX_HEADS-1)( 7 downto 0);
signal diag_peek_wrptr_int : print_vec_t(0 to MAX_HEADS-1)( 7 downto 0);
signal print_unit_dbg : std_logic_vector(15 downto 0);
signal dest_port_wr : std_logic_vector(MAX_HEADS downto 0);
signal dest_port_rdy : std_logic_vector(MAX_HEADS downto 0);
signal ps_debug : std_logic_vector(19 downto 0);
signal en_dual_data_path : std_logic;
signal dac_0v_value : std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
signal print_all_on_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_latch_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_clk_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_data_int : std_logic_vector(MAX_HEADS * MAX_OP_WIDTH - 1 downto 0);
signal print_unit_dbg : std_logic_vector(15 downto 0);
signal dest_port_wr : std_logic_vector(MAX_HEADS downto 0);
signal dest_port_rdy : std_logic_vector(MAX_HEADS downto 0);
signal ps_debug : std_logic_vector(19 downto 0);
signal diag_word_count : diag_wc_vec_t;
signal dac_0v_value : std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
signal print_all_on_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_latch_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_clk_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal print_data_int : std_logic_vector(MAX_HEADS * MAX_OP_WIDTH - 1 downto 0);
signal combine_chans : std_logic;
signal combine_chans_int : std_logic;
signal all_on_emul : std_logic_vector(3 downto 0);
--diags
signal diag_nonzero_head : diag_wc_vec_t;
signal print_clk_int_d : std_logic_vector(MAX_HEADS - 1 downto 0);
signal diag_nonzero_clr : std_logic_vector(MAX_HEADS - 1 downto 0);
signal diag_nonzero_inc : std_logic_vector(MAX_HEADS - 1 downto 0);
signal debug_wr_if_ctrl_enable : std_logic;
signal debug_wr_if_ctrl_clr : std_logic;
signal debug_wr_if_ctrl_update_addr : std_logic;
signal debug_wr_if_ctrl_trig_underrun: std_logic;
signal debug_wr_if_ctrl_trig_dbl_drop: std_logic;
signal debug_wr_if_ctrl_trig_now : std_logic;
signal debug_wr_if_base_addr : std_logic_vector(31 downto 0);
signal debug_wr_if_end_addr : std_logic_vector(31 downto 0);
signal debug_wr_if_bytes_written : std_logic_vector(31 downto 0);
signal debug_wr_if_status_overflow : std_logic;
signal debug_wr_if_status_triggered : std_logic;
signal debug_wr_if_status_write_busy : std_logic;
signal debug_wr_if_ctrl_smpl_wr_addr : std_logic;
signal debug_wr_if_wr_addr : std_logic_vector(31 downto 0);
signal combine_chans : std_logic;
signal combine_chans_int : std_logic;
signal all_on_emul : std_logic_vector(3 downto 0);
begin
process (all)
begin
for i in 0 to NUM_HEADS-1 loop
fire_req_in0(i) <= fire_req(i)(0);
fire_req_start_merge_in0(i) <= fire_req_start_merge(i)(0);
end loop;
end process;
fire_req_int <= (others => '1') when cpu_fire_req_pulse = '1' else fire_req_in0;
fire_req_start_merge_int <= (others => '1') when cpu_fire_req_start_merge_plse = '1' else fire_req_start_merge_in0;
fire_req_data_int <= fire_data when unsigned(fire_req_in0) /= 0 else cpu_fire_req_data;
cpu_fire_req_start_merge_plse <= cpu_fire_req_start_merge and cpu_fire_req_pulse;
GEN_TIE_OFF_REQD : if MAX_HEADS > NUM_HEADS generate
GEN_TIE_OFF : for i in NUM_HEADS to MAX_HEADS - 1 generate
avs_seq_readdata_int(i) <= (others => '0');
@ -254,18 +320,6 @@ begin
combine_chans_int <= combine_chans;
end generate;
-- Convert input fire request to a pulse on the falling egde
process(clk, rst_n) is
begin
if rst_n = '0' then
fire_req_dly(NUM_HEADS - 1 downto 0) <= (others => '0');
elsif clk'event and clk = '1' then
fire_req_dly(NUM_HEADS - 1 downto 0) <= fire_req;
end if;
end process;
-- Pulse at falling edge
fire_req_edge(NUM_HEADS - 1 downto 0) <= fire_req_dly(NUM_HEADS - 1 downto 0) and not fire_req;
-- STM8 trigger whenever any print unit outputs trigger
stm8_trigger_rx <= '1' when to_integer(unsigned(stm8_trigger_rx_int)) /= 0 else '0';
@ -278,8 +332,8 @@ begin
-- Decode the CSR access for each print unit controller
print_ctrl_csr_decode_inst : entity work.print_ctrl_csr_decode
generic map(
ADDR_DECODE_HI_BIT => 9,
ADDR_DECODE_LO_BIT => 6
ADDR_DECODE_HI_BIT => 10,
ADDR_DECODE_LO_BIT => 7
)
port map(
print_unit_0_write => avs_csr_write_int(0),
@ -301,7 +355,7 @@ begin
local_read => local_read,
local_readdata => local_readdata,
avs_address => avs_csr_address(9 downto 6),
avs_address => avs_csr_address(10 downto 7),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
@ -333,10 +387,13 @@ begin
avs_readdata => avs_seq_readdata
);
-- -----------------------------------------------
-- Local register block for print_ctrl
-- -----------------------------------------------
print_ctrl_csr_regs_inst : entity work.print_ctrl_csr_regs
generic map(
ADDR_DECODE_WIDTH => 4
ADDR_DECODE_WIDTH => 5
)
port map(
clk => clk,
@ -351,12 +408,13 @@ begin
control_chan_en => chan_en,
control_data_width => print_data_width,
control_cpu_gl_map => cpu_gl_map_en,
control_cpu_px_sel => control_cpu_px_sel,
control_cpu_px_sel => cpu_px_sel,
control_head_data_map_rev => head_data_map_rev,
control_fpm_select_pof_niso => fpm_select_pof_niso,
control_en_test_fp_logic => en_test_fp_logic,
control_en_test_pwr_ctrl => en_test_pwr_ctrl,
control_clear_px_buf => clear_buffer,
control_en_dual_data_path => en_dual_data_path,
control_cpu_adc_meas => cpu_adc_meas(0),
control_combine_chans => combine_chans,
control_all_on_emul => all_on_emul,
@ -384,27 +442,99 @@ begin
cpu_push_px_buf_in => (others => '0'),
cpu_fire_req_pulse => cpu_fire_req_pulse,
cpu_fire_req => cpu_fire_req,
cpu_fire_req_in => (others => '0'),
cpu_fire_req_start_merge => cpu_fire_req_start_merge,
cpu_fire_req_start_merge_in => '0',
cpu_fire_req_mask => cpu_fire_req_mask,
cpu_fire_req_mask_in => (others => '0'),
cpu_fire_req_seq_addr => cpu_fire_req_data,
cpu_fire_req_seq_addr_in => (others => '0'),
cpu_start_seq_pulse => cpu_start_seq_pulse,
cpu_start_seq_go => cpu_start_seq_go,
cpu_start_seq_go_in => (others => '0'),
cpu_start_seq_address => cpu_start_seq_address,
cpu_start_seq_address_in => (others => '0'),
diag_nonzero_head0 => diag_nonzero_head(0),
diag_nonzero_head1 => diag_nonzero_head(1),
diag_nonzero_head2 => diag_nonzero_head(2),
diag_nonzero_head3 => diag_nonzero_head(3),
diag_nonzero_clr => diag_nonzero_clr,
debug_wr_if_ctrl_enable => debug_wr_if_ctrl_enable,
debug_wr_if_ctrl_clr => debug_wr_if_ctrl_clr,
debug_wr_if_ctrl_update_addr => debug_wr_if_ctrl_update_addr,
debug_wr_if_ctrl_trig_underrun=> debug_wr_if_ctrl_trig_underrun,
debug_wr_if_ctrl_trig_dbl_drop=> debug_wr_if_ctrl_trig_dbl_drop,
debug_wr_if_ctrl_trig_now => debug_wr_if_ctrl_trig_now,
debug_wr_if_base_addr => debug_wr_if_base_addr,
debug_wr_if_end_addr => debug_wr_if_end_addr,
debug_wr_if_bytes_written => debug_wr_if_bytes_written,
debug_wr_if_status_overflow => debug_wr_if_status_overflow,
debug_wr_if_status_write_busy => debug_wr_if_status_write_busy,
debug_wr_if_status_triggered => debug_wr_if_status_triggered,
debug_wr_if_ctrl_smpl_wr_addr => debug_wr_if_ctrl_smpl_wr_addr,
debug_wr_if_wr_addr => debug_wr_if_wr_addr,
seq_status_data_core_empty => empty,
seq_status_data_core_overrun => overrun,
seq_status_data_core_underrun => underrun,
seq_status_data_core_fp_drop => fp_drop,
seq_status_data_core_dbl_drop => dbl_drop,
seq_status_overlap_error => overlap_error,
seq_status_wave_seq_busy => wave_seq_busy,
seq_status_print_seq_busy => print_seq_busy,
dac_0v_value => dac_0v_value,
avs_address => avs_csr_address(3 downto 0),
avs_address => avs_csr_address(4 downto 0),
avs_write => local_write,
avs_writedata => avs_csr_writedata,
avs_read => local_read,
avs_readdata => local_readdata
);
c_debug_wr_if : entity work.debug_wr_if
port map (
clk => clk,
rst_n => rst_n,
-- Control and status
enable => debug_wr_if_ctrl_enable,
clr => debug_wr_if_ctrl_clr,
trig_on_underrun => debug_wr_if_ctrl_trig_underrun,
trig_on_dbl_drop => debug_wr_if_ctrl_trig_dbl_drop,
trig_now => debug_wr_if_ctrl_trig_now,
update_addr => debug_wr_if_ctrl_update_addr,
new_base_addr_bytes => debug_wr_if_base_addr,
new_end_addr_bytes => debug_wr_if_end_addr,
bytes_written => debug_wr_if_bytes_written,
overflow => debug_wr_if_status_overflow,
wr_addr => debug_wr_if_wr_addr,
triggered => debug_wr_if_status_triggered,
write_busy => debug_wr_if_status_write_busy,
-- Data to monitor
fire_pulse(0) => fire_req(0)(0),
fire_pulse(1) => fire_req(1)(0),
fire_pulse(2) => fire_req(2)(0),
fire_pulse(3) => fire_req(3)(0),
underrun => underrun,
dbl_drop => dbl_drop,
clear_buffer => clear_buffer,
pof_rx_debug => pof_rx_debug,
-- Avalon Master burst write interface for FPGA configuration block
avm_tx_write => avm_tx_write,
avm_tx_waitrequest => avm_tx_waitrequest,
avm_tx_burstcount => avm_tx_burstcount,
avm_tx_address => avm_tx_address,
avm_tx_writedata => avm_tx_writedata,
avm_tx_last => avm_tx_last
);
-- Flag GMA99 mode for cable mappings when programmed data width indicates >= 16 (GMA99 is 18, GMA33 is 6)
gma99 <= print_data_width(4);
@ -412,14 +542,16 @@ begin
-- Only want a CPU instigated measurement to go to head 0 (they're ORed together anyway)
cpu_adc_meas(NUM_HEADS - 1 downto 1) <= (others => '0');
fire_req_int <= "1111" when cpu_fire_req_pulse = '1' else fire_req_edge;
fire_req_data_int <= fire_data when fire_req_edge /= "0000" else cpu_fire_req;
-- Instantiate 4 print_unit blocks; one for each head
GEN_PRINT_UNIT_LOOP : for i in 0 to NUM_HEADS - 1 generate
pixel_buf_wr_int(i) <= '1' when cpu_push_px_buf_pulse = '1' and control_cpu_px_sel = std_logic_vector(to_unsigned(i, 2)) else pixel_buf_wr(i);
pixel_buf_wr_data_int(i) <= cpu_push_px_buf when cpu_push_px_buf_pulse = '1' and control_cpu_px_sel = std_logic_vector(to_unsigned(i, 2)) else pixel_buf_wr_data;
pixel_buf_wr_int(i) <= '1' when cpu_push_px_buf_pulse = '1' and cpu_px_sel = std_logic_vector(to_unsigned(i, 2)) else pixel_buf_wr(i);
pixel_buf_wr_data_int(i) <= cpu_push_px_buf when cpu_push_px_buf_pulse = '1' and cpu_px_sel = std_logic_vector(to_unsigned(i, 2)) else pixel_buf_wr_data;
pixel_buf_wr_int(i+MAX_HEADS) <= '1' when cpu_push_px_buf_pulse = '1' and cpu_px_sel = std_logic_vector(to_unsigned(i+MAX_HEADS, 2)) else pixel_buf_wr(i+MAX_HEADS);
pixel_buf_wr_data_int(i+MAX_HEADS) <= cpu_push_px_buf when cpu_push_px_buf_pulse = '1' and cpu_px_sel = std_logic_vector(to_unsigned(i+MAX_HEADS, 2)) else pixel_buf_wr_data;
print_unit_inst : entity work.print_unit
generic map(
@ -428,73 +560,102 @@ begin
DAC_DATA_WIDTH => 14,
MAX_OP_WIDTH => MAX_OP_WIDTH,
SHIFT_DEPTH => SHIFT_DEPTH,
PCLK_CLK_RATIO => PCLK_CLK_RATIO
PCLK_CLK_RATIO => PCLK_CLK_RATIO,
NO_ZERO_GAP => NO_ZERO_GAP,
EN_PEEK => EN_PEEK
)
port map(
clk => clk,
rst_n => rst_n,
clk => clk,
rst_n => rst_n,
avs_csr_address => avs_csr_address(5 downto 0),
avs_csr_write => avs_csr_write_int(i),
avs_csr_writedata => avs_csr_writedata,
avs_csr_read => avs_csr_read_int(i),
avs_csr_readdata => avs_csr_readdata_int(i),
avs_csr_address => avs_csr_address(5 downto 0),
avs_csr_write => avs_csr_write_int(i),
avs_csr_writedata => avs_csr_writedata,
avs_csr_read => avs_csr_read_int(i),
avs_csr_readdata => avs_csr_readdata_int(i),
avs_seq_address => avs_seq_address(9 downto 0),
avs_seq_write => avs_seq_write_int(i),
avs_seq_writedata => avs_seq_writedata,
avs_seq_read => avs_seq_read_int(i),
avs_seq_readdata => avs_seq_readdata_int(i),
avs_seq_address => avs_seq_address(9 downto 0),
avs_seq_write => avs_seq_write_int(i),
avs_seq_writedata => avs_seq_writedata,
avs_seq_read => avs_seq_read_int(i),
avs_seq_readdata => avs_seq_readdata_int(i),
pixel_buf_wr => pixel_buf_wr_int(i),
pixel_buf_wr_data => pixel_buf_wr_data_int(i),
pixel_buf_rdy => pixel_buf_rdy(i),
pixel_buf_wr => pixel_buf_wr_int(i),
pixel_buf_wr_data => pixel_buf_wr_data_int(i),
pixel_buf_rdy => pixel_buf_rdy(i),
pixel_buf_last_word => pixel_buf_last_word,
all_on_emul => all_on_emul(i),
bpp_mode => bpp_mode(i)(1 downto 0),
chan_en => chan_en,
print_data_width => print_data_width,
clear_buffer => clear_buffer(i),
empty => empty(i),
full => full(i),
overrun => overrun(i),
underrun => underrun(i),
fp_drop => fp_drop(i),
dbl_drop => dbl_drop(i),
all_on_emul => all_on_emul(i),
cpu_gl_map => cpu_gl_map_head(i),
cpu_gl_map_en => cpu_gl_map_en,
pixel_buf_wr_aux => pixel_buf_wr_int(i+MAX_HEADS),
pixel_buf_wr_data_aux => pixel_buf_wr_data_int(i+MAX_HEADS),
pixel_buf_rdy_aux => pixel_buf_rdy(i+MAX_HEADS),
pixel_buf_last_word_aux => pixel_buf_last_word,
cpu_start_dly_head => cpu_start_dly_head(i),
cpu_data_start => cpu_data_start(i),
cpu_data_start_first => cpu_data_start_first(i),
cpu_data_start_last => cpu_data_start_last(i),
cpu_adc_meas => cpu_adc_meas(i),
en_dual_data_path => en_dual_data_path,
bpp_mode => bpp_mode(i)(1 downto 0),
chan_en => chan_en,
print_data_width => print_data_width,
clear_buffer => clear_buffer(i),
empty => empty(i),
full => full(i),
overrun => overrun(i),
underrun => underrun(i),
fp_drop => fp_drop(i),
dbl_drop => dbl_drop(i),
overlap_error => overlap_error(i),
fire_req => fire_req_int(i),
fire_data => fire_req_data_int,
cpu_gl_map => cpu_gl_map_head(i),
cpu_gl_map_en => cpu_gl_map_en,
stm8_trigger_rx => stm8_trigger_rx_int(i),
sig_seq_force_dacs_0v => sig_seq_force_dacs_0v,
dac_0v_value => dac_0v_value,
cpu_start_dly_head => cpu_start_dly_head(i),
cpu_data_start => cpu_data_start(i),
cpu_data_start_first => cpu_data_start_first(i),
cpu_data_start_last => cpu_data_start_last(i),
cpu_adc_meas => cpu_adc_meas(i),
wave_req_ext => wave_req_cpu(i),
wave_addr_ext => wave_addr_cpu(i),
wave_delay_ext => (others => '0'),
fire_req => fire_req_int(i),
fire_req_start_merge => fire_req_start_merge_int(i),
fire_data => fire_req_data_int,
seq_dac_data => seq_dac_data_int(i),
wave_seq_busy => wave_seq_busy(i),
print_seq_busy => print_seq_busy(i),
px_buf_ch_nactive => px_buf_ch_nactive(i*NUM_CHANS+NUM_CHANS-1 downto i*NUM_CHANS),
print_all_on => print_all_on_int(i),
print_latch => print_latch_int(i),
print_clk => print_clk_int(i downto i),
print_data => print_data_int(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH),
diag_word_count => diag_word_count(i),
stm8_trigger_rx => stm8_trigger_rx_int(i),
debug_out => print_unit_dbg((i * 4) + 3 downto (i * 4))
cpu_fire_req_start_merge => cpu_fire_req_start_merge,
cpu_fire_req_pulse => cpu_fire_req_pulse and not cpu_fire_req_mask(i),
cpu_start_seq_go => cpu_start_seq_go(i) and cpu_start_seq_pulse,
cpu_start_seq_address => cpu_start_seq_address,
sig_seq_force_dacs_0v => sig_seq_force_dacs_0v,
dac_0v_value => dac_0v_value,
wave_req_ext => wave_req_cpu(i),
wave_addr_ext => wave_addr_cpu(i),
wave_delay_ext => (others => '0'),
seq_dac_data => seq_dac_data_int(i),
wave_seq_busy => wave_seq_busy(i),
print_seq_busy => print_seq_busy(i),
print_all_on => print_all_on_int(i),
print_latch => print_latch_int(i),
print_clk => print_clk_int(i downto i),
print_data => print_data_int(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH),
diag_peek_sel => diag_peek_sel(i),
diag_peek_addr => diag_peek_addr,
diag_peek_data => diag_peek_data_int(i),
diag_peek_rdptr => diag_peek_rdptr_int(i),
diag_peek_wrptr => diag_peek_wrptr_int(i),
diag_peek_wdata => diag_peek_wdata,
diag_peek_wr => diag_peek_wr,
diag_word_count => diag_word_count(i),
debug_out => print_unit_dbg((i * 4) + 3 downto (i * 4))
);
end generate GEN_PRINT_UNIT_LOOP;
@ -520,8 +681,8 @@ begin
print_clk(i downto i) <= print_clk_int(i downto i);
-- When not combining, the maximum o/p width is take the bottom N bits from each channel
print_data(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH) <= print_data_int(3 * MAX_OP_WIDTH + MAX_OP_WIDTH / MAX_HEADS - 1 downto 3 * MAX_OP_WIDTH) &
print_data_int(2 * MAX_OP_WIDTH + MAX_OP_WIDTH / MAX_HEADS - 1 downto 2 * MAX_OP_WIDTH) &
print_data(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH) <= print_data_int(3 * MAX_OP_WIDTH + MAX_OP_WIDTH / MAX_HEADS - 1 downto 3 * MAX_OP_WIDTH) &
print_data_int(2 * MAX_OP_WIDTH + MAX_OP_WIDTH / MAX_HEADS - 1 downto 2 * MAX_OP_WIDTH) &
print_data_int(MAX_OP_WIDTH + MAX_OP_WIDTH / MAX_HEADS - 1 downto MAX_OP_WIDTH) &
print_data_int(MAX_OP_WIDTH / MAX_HEADS - 1 downto 0);
end if;
@ -548,14 +709,14 @@ begin
DAC_DATA_WIDTH => DAC_DATA_WIDTH
)
port map(
clk_x2 => clk_x2,
rst_n => rst_n,
seq_dac_data0 => seq_dac_data(i * 2),
seq_dac_data1 => seq_dac_data(i * 2 + 1),
dac_data => dac_data(i)
);
end generate GEN_DAC_IF_LOOP;
@ -565,10 +726,11 @@ begin
print_streamer_inst : entity work.print_streamer
generic map(
MAX_HEADS => MAX_HEADS,
NUM_HEADS => NUM_HEADS,
NUM_EXT_DSTS => NUM_HEADS + 1,
SLIM => SLIM
MAX_HEADS => MAX_HEADS,
NUM_HEADS => NUM_HEADS,
NUM_CHANS => NUM_CHANS,
NO_ZERO_GAP => NO_ZERO_GAP,
STREAMER_LOGGER => STREAMER_LOGGER
)
port map(
@ -581,14 +743,6 @@ begin
avs_csr_read => print_streamer_read,
avs_csr_readdata => print_streamer_readdata,
avm_rx_waitrequest => avm_rx_waitrequest,
avm_rx_burstcount => avm_rx_burstcount,
avm_rx_address => avm_rx_address,
avm_rx_read => avm_rx_read,
avm_rx_readdata => avm_rx_readdata,
avm_rx_readdatavalid => avm_rx_readdatavalid,
axm_awaddr => axm_awaddr,
axm_awprot => axm_awprot,
axm_awvalid => axm_awvalid,
@ -616,20 +770,45 @@ begin
axm_rvalid => axm_rvalid,
axm_rready => axm_rready,
dest_port_wr => dest_port_wr(NUM_HEADS downto 0),
dest_port_wr => pixel_buf_wr,
dest_port_wr_data => pixel_buf_wr_data,
dest_port_rdy => dest_port_rdy(NUM_HEADS downto 0),
dest_port_rdy => pixel_buf_rdy,
dest_port_last_word => pixel_buf_last_word,
debug_out => ps_debug
);
-- The first NUM_HEADS ready signals are from the head pixel buffers,
-- followed by the print streamer.
dest_port_rdy <= ps_rdy & pixel_buf_rdy;
-- DIAGs
P_DIAG : process(rst_n, clk) is
begin
if rst_n = '0' then
diag_nonzero_head <= (others => (others => '0'));
print_clk_int_d <= (others => '1');
diag_nonzero_inc <= (others => '0');
elsif clk'event and clk = '1' then
diag_nonzero_inc <= (others => '0');
print_clk_int_d <= print_clk_int;
pixel_buf_wr <= dest_port_wr(pixel_buf_wr'length - 1 downto 0);
ps_wr <= dest_port_wr(pixel_buf_wr'length);
ps_wr_data <= pixel_buf_wr_data;
for i in 0 to (MAX_HEADS-1) loop
if diag_nonzero_clr(i) then
diag_nonzero_head(i) <= (others => '0');
else
if diag_nonzero_inc(i) = '1' then
if unsigned(diag_nonzero_head(i)) /= 127 then
diag_nonzero_head(i) <= std_logic_vector(unsigned(diag_nonzero_head(i))+1);
end if;
end if;
end if;
if print_clk_int(i) = '0' and print_clk_int_d(i) = '1' then
if unsigned(print_data_int(i * MAX_OP_WIDTH + 7 downto i * MAX_OP_WIDTH)) /= 0 then
diag_nonzero_inc(i) <= '1';
end if;
end if;
end loop;
end if;
end process;
end rtl;

View file

@ -113,7 +113,7 @@
},
"status" : {
"address" : "4",
"width" : "28",
"width" : "26",
"description" : "Command port",
"fields" : {
"queue_space" : {
@ -122,18 +122,6 @@
"reset" : "16",
"description" : "Amount of command space left in queue, in units of commands (2 words). I.e. when 1, can write a single command of two words."
},
"tlb_mismatch_err" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "TLB mapping mis-match error."
},
"tlb_empty_err" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "TLB empty error."
},
"auto_load_err" : {
"type" : "r",
"bit_len" : "1",
@ -180,7 +168,7 @@
},
"diags" : {
"address" : "5",
"width" : "20",
"width" : "28",
"description" : "Command port",
"fields" : {
"remain" : {
@ -218,6 +206,12 @@
"bit_len" : "1",
"reset" : "0",
"description" : "Destination ready"
},
"logger_wr_ptr" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Data streamer command logger write pointer"
}
}
},
@ -324,6 +318,13 @@
"type" : "w",
"reset" : "0",
"description" : "Redirection read address"
},
"diag_logger_rdata" : {
"address" : "15",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Data streamer command queue logger read data"
}
}
}

View file

@ -1,7 +1,7 @@
[{
"ip_name" : "print_streamer",
"bus" : "csr",
"addr_hi_bit" : "5",
"addr_hi_bit" : "6",
"addr_lo_bit" : "4",
"description" : "This block is the top level for the GMA SOM board soft IP",
"sub_blocks" : {
@ -24,6 +24,26 @@
"instance" : "3",
"process" : "enabled",
"offset" : "0x30"
},
"data_streamer:e" : {
"instance" : "0_aux",
"process" : "enabled",
"offset" : "0x40"
},
"data_streamer:f" : {
"instance" : "1_aux",
"process" : "enabled",
"offset" : "0x50"
},
"data_streamer:g" : {
"instance" : "2_aux",
"process" : "enabled",
"offset" : "0x60"
},
"data_streamer:h" : {
"instance" : "3_aux",
"process" : "enabled",
"offset" : "0x70"
}
}
}]

View file

@ -26,7 +26,6 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
entity avm_to_axi_master is
generic (
@ -35,21 +34,21 @@ entity avm_to_axi_master is
);
port (
en_acp_window : in std_logic;
--AXI write address bus
axm_awaddr : out std_logic_vector(31 downto 0) := (others => '0');
axm_awprot : out std_logic_vector( 2 downto 0) := (others => '0');
axm_awaddr : out std_logic_vector(31 downto 0) := (others => '0'); -- @suppress "Unused port: axm_awaddr is not used in work.avm_to_axi_master(rtl)"
axm_awprot : out std_logic_vector( 2 downto 0) := (others => '0'); -- @suppress "Unused port: axm_awprot is not used in work.avm_to_axi_master(rtl)"
axm_awvalid : out std_logic; --master addr valid
axm_awready : in std_logic; --slave ready to accept
axm_awready : in std_logic; --slave ready to accept -- @suppress "Unused port: axm_awready is not used in work.avm_to_axi_master(rtl)"
--AXI write data bus
axm_wdata : out std_logic_vector(31 downto 0) := (others => '0');
axm_wlast : out std_logic := '0'; --last transfer in burst
axm_wdata : out std_logic_vector(31 downto 0) := (others => '0'); -- @suppress "Unused port: axm_wdata is not used in work.avm_to_axi_master(rtl)"
axm_wlast : out std_logic := '0'; --last transfer in burst -- @suppress "Unused port: axm_wlast is not used in work.avm_to_axi_master(rtl)"
axm_wvalid : out std_logic; --master data valid
axm_wready : in std_logic; --slave ready to accept
axm_wready : in std_logic; --slave ready to accept -- @suppress "Unused port: axm_wready is not used in work.avm_to_axi_master(rtl)"
--AXI write response bus
axm_bvalid : in std_logic;
axm_bvalid : in std_logic; -- @suppress "Unused port: axm_bvalid is not used in work.avm_to_axi_master(rtl)"
axm_bready : out std_logic;
--AXI read address bus
@ -69,18 +68,13 @@ entity avm_to_axi_master is
axm_rready : out std_logic; --master ready to accept
-- AVM input port 0
avm_rx_read0 : in std_logic;
avm_rx_burstcount0 : in std_logic_vector(11 downto 0);
avm_rx_address0 : in std_logic_vector(31 downto 0);
-- AVM input port 1
avm_rx_read1 : in std_logic;
avm_rx_burstcount1 : in std_logic_vector(11 downto 0);
avm_rx_address1 : in std_logic_vector(31 downto 0);
avm_rx_read : in std_logic;
avm_rx_burstcount : in std_logic_vector(11 downto 0);
avm_rx_address : in std_logic_vector(31 downto 0);
-- AVM common signals
avm_rx_waitrequest : out std_logic;
avm_rx_waitrequest : out std_logic;
avm_rx_readdata : out std_logic_vector(31 downto 0);
avm_rx_readdatavalid : out std_logic
@ -89,26 +83,20 @@ end entity;
architecture rtl of avm_to_axi_master is
signal avm_rx_read : std_logic;
signal avm_rx_address : std_logic_vector(31 downto 0);
signal avm_rx_burstcount : std_logic_vector(11 downto 0);
begin
-- Mux the Avalon master bus between port 0 and port 1. Port 0 has priority.
avm_rx_read <= avm_rx_read0 or avm_rx_read1;
avm_rx_address <= avm_rx_address0 when avm_rx_read0 = '1' else avm_rx_address1;
avm_rx_burstcount <= avm_rx_burstcount0 when avm_rx_read0 = '1' else avm_rx_burstcount1;
axm_awvalid <= '0';
axm_wvalid <= '0';
axm_bready <= '0';
axm_arvalid <= avm_rx_read;
axm_araddr <= en_acp_window & avm_rx_address(30 downto 0); -- Access via ACP window (bit 31 set)
axm_araddr <= '1' & avm_rx_address(30 downto 0) when en_acp_window = '1' else -- Access via ACP window (bit 31 set)
avm_rx_address(31 downto 0); -- Can access any location including ACP window
axm_arlen <= std_logic_vector(unsigned(avm_rx_burstcount(7 downto 0)) - 1);
axm_arsize <= 3X"2"; -- 4 bytes transfers (2^ARSIZE bytes)
axm_arburst <= "01"; -- Increment
axm_arburst <= "01"; -- Increment
axm_arprot <= "000"; -- Unpriviledged, non-secure, data access
axm_arcache <= ARCACHE;
axm_aruser <= ARUSER;

View file

@ -27,7 +27,6 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
package mem_arbiter_pkg is
type bus_array_t is array(natural range <>) of std_logic_vector;
@ -36,27 +35,26 @@ end package;
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.pkg_functions.all;
--use work.pkg_functions.all;
use work.mem_arbiter_pkg.all;
entity mem_arbiter is
generic (
NUM_HEADS : natural range 1 to 4 := 4
NUM_PORTS : natural range 1 to 16 := 8
);
port (
clk : in std_logic;
rst_n : in std_logic;
transfer_active : in std_logic_vector(NUM_HEADS-1 downto 0);
avm_rx_waitrequest_in : out std_logic_vector(NUM_HEADS-1 downto 0);
avm_rx_burstcount_in : in bus_array_t (0 to NUM_HEADS-1)(11 downto 0);
avm_rx_address_in : in bus_array_t (0 to NUM_HEADS-1)(31 downto 0);
avm_rx_read_in : in std_logic_vector(NUM_HEADS-1 downto 0);
avm_rx_readdata_in : out bus_array_t (0 to NUM_HEADS-1)(31 downto 0);
avm_rx_readdatavalid_in : out std_logic_vector(NUM_HEADS-1 downto 0);
transfer_active : in std_logic_vector(NUM_PORTS-1 downto 0);
avm_rx_waitrequest_in : out std_logic_vector(NUM_PORTS-1 downto 0);
avm_rx_burstcount_in : in bus_array_t (0 to NUM_PORTS-1)(11 downto 0);
avm_rx_address_in : in bus_array_t (0 to NUM_PORTS-1)(31 downto 0);
avm_rx_read_in : in std_logic_vector(NUM_PORTS-1 downto 0);
avm_rx_readdata_in : out bus_array_t (0 to NUM_PORTS-1)(31 downto 0);
avm_rx_readdatavalid_in : out std_logic_vector(NUM_PORTS-1 downto 0);
avm_rx_waitrequest : in std_logic;
avm_rx_burstcount : out std_logic_vector(11 downto 0);
@ -71,17 +69,17 @@ end entity mem_arbiter;
architecture rtl of mem_arbiter is
signal enable : std_logic_vector(NUM_HEADS-1 downto 0);
signal mask : std_logic_vector(NUM_HEADS-1 downto 0);
signal reqs : std_logic_vector(NUM_HEADS-1 downto 0);
signal prior_choice : std_logic_vector(NUM_HEADS-1 downto 0);
signal any_choice : std_logic_vector(NUM_HEADS-1 downto 0);
signal transfer_active_dly : std_logic_vector(NUM_HEADS-1 downto 0);
signal enable : std_logic_vector(NUM_PORTS-1 downto 0);
signal mask : std_logic_vector(NUM_PORTS-1 downto 0);
signal reqs : std_logic_vector(NUM_PORTS-1 downto 0);
signal prior_choice : std_logic_vector(NUM_PORTS-1 downto 0);
signal any_choice : std_logic_vector(NUM_PORTS-1 downto 0);
signal transfer_active_dly : std_logic_vector(NUM_PORTS-1 downto 0);
signal sel_trans_end : std_logic;
begin
GEN_ARB_LOOP : for i in 0 to NUM_HEADS-1 generate
GEN_ARB_LOOP : for i in 0 to NUM_PORTS-1 generate
avm_rx_waitrequest_in(i) <= avm_rx_waitrequest or not enable(i);
avm_rx_readdata_in(i) <= avm_rx_readdata;
@ -90,39 +88,60 @@ GEN_ARB_LOOP : for i in 0 to NUM_HEADS-1 generate
end generate GEN_ARB_LOOP;
-- Mux burst count on selected source
avm_rx_burstcount <= avm_rx_burstcount_in(3) when enable(3) = '1' else
avm_rx_burstcount <= avm_rx_burstcount_in(7) when enable(7) = '1' else
avm_rx_burstcount_in(6) when enable(6) = '1' else
avm_rx_burstcount_in(5) when enable(5) = '1' else
avm_rx_burstcount_in(4) when enable(4) = '1' else
avm_rx_burstcount_in(3) when enable(3) = '1' else
avm_rx_burstcount_in(2) when enable(2) = '1' else
avm_rx_burstcount_in(1) when enable(1) = '1' else
avm_rx_burstcount_in(0);
-- Mux address on selected source
avm_rx_address <= avm_rx_address_in(3) when enable(3) = '1' else
avm_rx_address <= avm_rx_address_in(7) when enable(7) = '1' else
avm_rx_address_in(6) when enable(6) = '1' else
avm_rx_address_in(5) when enable(5) = '1' else
avm_rx_address_in(4) when enable(4) = '1' else
avm_rx_address_in(3) when enable(3) = '1' else
avm_rx_address_in(2) when enable(2) = '1' else
avm_rx_address_in(1) when enable(1) = '1' else
avm_rx_address_in(0);
-- Issue a read whenever an enabled channel is requesting
avm_rx_read <= '1' when (enable and avm_rx_read_in) /= 4x"0" else '0';
avm_rx_read <= '1' when (enable and avm_rx_read_in) /= 8x"0" else '0';
-- Request vector for prioritised channels
reqs <= avm_rx_read_in and not mask;
-- Priority encoder to choose from one or more reqs
prior_choice <= "1000" when reqs(3) else
"0100" when reqs(2) else
"0010" when reqs(1) else
"0001";
prior_choice <= std_logic_vector(to_unsigned(2#10000000#, NUM_PORTS)) when reqs(7) else
std_logic_vector(to_unsigned(2#01000000#, NUM_PORTS)) when reqs(6) else
std_logic_vector(to_unsigned(2#00100000#, NUM_PORTS)) when reqs(5) else
std_logic_vector(to_unsigned(2#00010000#, NUM_PORTS)) when reqs(4) else
std_logic_vector(to_unsigned(2#00001000#, NUM_PORTS)) when reqs(3) else
std_logic_vector(to_unsigned(2#00000100#, NUM_PORTS)) when reqs(2) else
std_logic_vector(to_unsigned(2#00000010#, NUM_PORTS)) when reqs(1) else
std_logic_vector(to_unsigned(2#00000001#, NUM_PORTS));
-- Priority encoder to choose from any requesting channel
any_choice <= "0001" when avm_rx_read_in(0) else
"0010" when avm_rx_read_in(1) else
"0100" when avm_rx_read_in(2) else
"1000";
any_choice <= std_logic_vector(to_unsigned(2#00000001#, NUM_PORTS)) when avm_rx_read_in(0) else
std_logic_vector(to_unsigned(2#00000010#, NUM_PORTS)) when avm_rx_read_in(1) else
std_logic_vector(to_unsigned(2#00000100#, NUM_PORTS)) when avm_rx_read_in(2) else
std_logic_vector(to_unsigned(2#00001000#, NUM_PORTS)) when avm_rx_read_in(3) else
std_logic_vector(to_unsigned(2#00010000#, NUM_PORTS)) when avm_rx_read_in(4) else
std_logic_vector(to_unsigned(2#00100000#, NUM_PORTS)) when avm_rx_read_in(5) else
std_logic_vector(to_unsigned(2#01000000#, NUM_PORTS)) when avm_rx_read_in(6) else
std_logic_vector(to_unsigned(2#10000000#, NUM_PORTS));
-- Flag when selected channel end a transfer
sel_trans_end <= (transfer_active_dly(0) and not transfer_active(0) and enable(0)) or
(transfer_active_dly(1) and not transfer_active(1) and enable(1)) or
(transfer_active_dly(2) and not transfer_active(2) and enable(2)) or
(transfer_active_dly(3) and not transfer_active(3) and enable(3));
(transfer_active_dly(3) and not transfer_active(3) and enable(3)) or
(transfer_active_dly(4) and not transfer_active(4) and enable(4)) or
(transfer_active_dly(5) and not transfer_active(5) and enable(5)) or
(transfer_active_dly(6) and not transfer_active(6) and enable(6)) or
(transfer_active_dly(7) and not transfer_active(7) and enable(7));
-- Arbitration state process
process (clk, rst_n)
@ -140,7 +159,7 @@ end generate GEN_ARB_LOOP;
-- If no active channel or just ending a transfer, arbitrate for any new requests
if unsigned(enable) = 0 or sel_trans_end = '1' then
-- By default clear any outstanding enable.
enable <= (others => '0');

View file

@ -31,77 +31,71 @@
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.pkg_functions.all;
use work.mem_arbiter_pkg.all;
entity print_streamer is
generic(
CMD_QUEUE_DEPTH : natural range 1 to 1024 := 32;
MAX_HEADS : natural range 1 to 4 := 4;
NUM_HEADS : natural range 1 to 4 := 4;
NUM_EXT_DSTS : natural range 1 to 16 := 5; -- NUM_HEADS+1
SLIM : boolean := false
generic (
CMD_QUEUE_DEPTH : natural range 1 to 1024 := 32;
MAX_HEADS : natural range 1 to 4 := 4;
NUM_HEADS : natural range 1 to 4 := 4;
NUM_CHANS : natural range 1 to 16 := 2;
NO_ZERO_GAP : boolean := false;
STREAMER_LOGGER : boolean := false;
LOGGER_DEPTH : integer range 1 to 1024 := 256
);
port(
clk : in std_logic;
rst_n : in std_logic;
clk : in std_logic;
rst_n : in std_logic;
avs_csr_address : in std_logic_vector(9 downto 0);
avs_csr_write : in std_logic;
avs_csr_writedata : in std_logic_vector(31 downto 0);
avs_csr_read : in std_logic;
avs_csr_readdata : out std_logic_vector(31 downto 0);
-- External master port for access to memory system via AXI bus
avm_rx_waitrequest : out std_logic;
avm_rx_burstcount : in std_logic_vector(11 downto 0);
avm_rx_address : in std_logic_vector(31 downto 0);
avm_rx_read : in std_logic;
avm_rx_readdata : out std_logic_vector(31 downto 0);
avm_rx_readdatavalid : out std_logic;
avs_csr_address : in std_logic_vector(10 downto 0);
avs_csr_write : in std_logic;
avs_csr_writedata : in std_logic_vector(31 downto 0);
avs_csr_read : in std_logic;
avs_csr_readdata : out std_logic_vector(31 downto 0);
--AXI write address bus
axm_awaddr : out std_logic_vector(31 downto 0);
axm_awprot : out std_logic_vector(2 downto 0);
axm_awvalid : out std_logic; --master addr valid
axm_awready : in std_logic; --slave ready to accept
axm_awaddr : out std_logic_vector(31 downto 0);
axm_awprot : out std_logic_vector( 2 downto 0);
axm_awvalid : out std_logic; --master addr valid
axm_awready : in std_logic; --slave ready to accept
--AXI write data bus
axm_wdata : out std_logic_vector(31 downto 0);
axm_wlast : out std_logic; --last transfer in burst
axm_wvalid : out std_logic; --master data valid
axm_wready : in std_logic; --slave ready to accept
axm_wdata : out std_logic_vector(31 downto 0);
axm_wlast : out std_logic; --last transfer in burst
axm_wvalid : out std_logic; --master data valid
axm_wready : in std_logic; --slave ready to accept
--AXI write response bus
axm_bvalid : in std_logic;
axm_bready : out std_logic;
axm_bvalid : in std_logic;
axm_bready : out std_logic;
--AXI read address bus
axm_araddr : out std_logic_vector(31 downto 0);
axm_arlen : out std_logic_vector(7 downto 0); --burst length - 1 to 256 (ARLEN = burst len -1)
axm_arsize : out std_logic_vector(2 downto 0); --size, nb bytes, of each transfer in burst
axm_arburst : out std_logic_vector(1 downto 0); --for bursts>1, accept only incr burst=01
axm_arcache : out std_logic_vector(3 downto 0);
axm_aruser : out std_logic;
axm_arprot : out std_logic_vector(2 downto 0);
axm_arvalid : out std_logic; --master addr valid
axm_arready : in std_logic; --slave ready to accept
axm_araddr : out std_logic_vector(31 downto 0);
axm_arlen : out std_logic_vector( 7 downto 0); --burst length - 1 to 256 (ARLEN = burst len -1)
axm_arsize : out std_logic_vector( 2 downto 0); --size, nb bytes, of each transfer in burst
axm_arburst : out std_logic_vector( 1 downto 0); --for bursts>1, accept only incr burst=01
axm_arcache : out std_logic_vector( 3 downto 0);
axm_aruser : out std_logic;
axm_arprot : out std_logic_vector( 2 downto 0);
axm_arvalid : out std_logic; --master addr valid
axm_arready : in std_logic; --slave ready to accept
-- AXI read data bus
axm_rdata : in std_logic_vector(31 downto 0);
axm_rvalid : in std_logic; --slave data valid
axm_rready : out std_logic; --master ready to access
axm_rdata : in std_logic_vector(31 downto 0);
axm_rvalid : in std_logic; --slave data valid
axm_rready : out std_logic; --master ready to access
dest_port_wr : out std_logic_vector(NUM_EXT_DSTS - 1 downto 0);
dest_port_wr_data : out std_logic_vector(31 downto 0);
dest_port_rdy : in std_logic_vector(NUM_EXT_DSTS - 1 downto 0);
dest_port_wr : out std_logic_vector(MAX_HEADS*NUM_CHANS-1 downto 0);
dest_port_wr_data : out std_logic_vector(31 downto 0);
dest_port_rdy : in std_logic_vector(MAX_HEADS*NUM_CHANS-1 downto 0);
dest_port_last_word : out std_logic;
irq : out std_logic;
irq : out std_logic;
debug_out : out std_logic_vector(19 downto 0)
debug_out : out std_logic_vector(19 downto 0)
);
@ -109,438 +103,509 @@ end entity print_streamer;
architecture rtl of print_streamer is
constant CMD_QUEUE_DEPTH_LOG2 : integer := log2(CMD_QUEUE_DEPTH) - 1;
constant CMD_QUEUE_DEPTH_LOG2 : integer := log2(CMD_QUEUE_DEPTH);
type queue_spc_t is array (0 to NUM_HEADS - 1) of std_logic_vector(5 downto 0);
type watermark_t is array (0 to NUM_HEADS - 1) of std_logic_vector(7 downto 0);
type handle_t is array (0 to NUM_HEADS - 1) of std_logic_vector(11 downto 0);
type debug_t is array (0 to NUM_HEADS - 1) of std_logic_vector(19 downto 0);
-- Data streamer control and status
signal cmd_port_pulse : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal cmd_port : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal status_queue_space : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 5 downto 0);
signal control_clear_cmd : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal control_clear_errors : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal control_msb : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal control_watermark : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 7 downto 0);
signal control_en_acp_window : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal control_disable : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal control_clr_dst0_count : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal auto_cmd_active : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal auto_load_err : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal bad_cmd_err : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal cpu_race_err : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal overrun_err : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal handle : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(11 downto 0);
signal cmd_port_pulse : std_logic_vector(NUM_HEADS - 1 downto 0);
signal cmd_port : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal status_queue_space : queue_spc_t;
signal control_clear_cmd : std_logic_vector(NUM_HEADS - 1 downto 0);
signal control_clear_errors : std_logic_vector(NUM_HEADS - 1 downto 0);
signal control_msb : std_logic_vector(NUM_HEADS - 1 downto 0);
signal control_watermark : watermark_t;
signal control_en_acp_window : std_logic_vector(NUM_HEADS - 1 downto 0);
signal control_disable : std_logic_vector(NUM_HEADS - 1 downto 0);
signal control_clr_dst0_count : std_logic_vector(NUM_HEADS - 1 downto 0);
signal auto_cmd_active : std_logic_vector(NUM_HEADS - 1 downto 0);
signal auto_load_err : std_logic_vector(NUM_HEADS - 1 downto 0);
signal bad_cmd_err : std_logic_vector(NUM_HEADS - 1 downto 0);
signal cpu_race_err : std_logic_vector(NUM_HEADS - 1 downto 0);
signal overrun_err : std_logic_vector(NUM_HEADS - 1 downto 0);
signal handle : handle_t;
-- Avalon read interfaces from the data streamers
signal avm_rx_burstcount_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(11 downto 0);
signal avm_rx_address_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal avm_rx_read_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal avm_rx_waitrequest_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal avm_rx_readdata_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal avm_rx_readdatavalid_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal avm_rx_burstcount_int : bus_array_t(0 to MAX_HEADS - 1)(11 downto 0);
signal avm_rx_address_int : bus_array_t(0 to MAX_HEADS - 1)(31 downto 0);
signal avm_rx_read_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal avm_rx_waitrequest_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal avm_rx_readdata_int : bus_array_t(0 to MAX_HEADS - 1)(31 downto 0);
signal avm_rx_readdatavalid_int : std_logic_vector(MAX_HEADS - 1 downto 0);
-- Arbitrated avalon read interface
signal avm_rx_waitrequest_arb : std_logic;
signal avm_rx_burstcount_arb : std_logic_vector(11 downto 0);
signal avm_rx_address_arb : std_logic_vector(31 downto 0);
signal avm_rx_read_arb : std_logic;
signal avm_rx_readdata_arb : std_logic_vector(31 downto 0);
signal avm_rx_readdatavalid_arb : std_logic;
signal avm_rx_waitrequest_arb : std_logic;
signal avm_rx_burstcount_arb : std_logic_vector(11 downto 0);
signal avm_rx_address_arb : std_logic_vector(31 downto 0);
signal avm_rx_read_arb : std_logic;
signal avm_rx_readdata_arb : std_logic_vector(31 downto 0);
signal avm_rx_readdatavalid_arb : std_logic;
-- Diagnostic signals
signal debug_out_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(19 downto 0);
signal diag_1 : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal diag_2 : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal dst0_word_count : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal debug_out_int : debug_t;
-- Register access signals for each of the data streamer register blocks
signal avs_csr_readdata_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal avs_csr_write_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal avs_csr_read_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal diag_1 : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal diag_2 : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal dst0_word_count : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
-- Streamer interrupt signal
signal irq_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal avs_csr_readdata_int : bus_array_t(0 to MAX_HEADS - 1)(31 downto 0);
signal avs_csr_write_int : std_logic_vector(MAX_HEADS - 1 downto 0);
signal avs_csr_read_int : std_logic_vector(MAX_HEADS - 1 downto 0);
-- Dta streamer data output write busses
signal dest_port_wr_data_int : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal dest_port_last_word_int : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal irq_int : std_logic_vector(NUM_HEADS - 1 downto 0);
-- Data streamer actives statuses
signal transfer_active : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal dest_port_wr_data_int : bus_array_t(0 to MAX_HEADS - 1)(31 downto 0);
-- Streamer FIFO signals
signal fifo_wr_port_pulse : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_wr_port : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal fifo_wr_port_in : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal fifo_rd_port : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal fifo_rd_port_pulse : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_status_empty : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_status_full : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_status_underrun : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_status_overrun : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_controls_clr_fifo : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_controls_clr_errors : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_controls_pop_rd_port : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal fifo_rd_addr : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal fifo_loop_count : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 9 downto 0);
signal dest_port_wr_0 : std_logic_vector(1 downto 0);
signal dest_port_rdy_0 : std_logic_vector(1 downto 0);
signal diag_cmd_q_write : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0);
signal diag_cmd_q_write_data : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal diag_cmd_q_read_data : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(31 downto 0);
signal diag_cmd_q_rd_addr : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(log2(LOGGER_DEPTH)-2 downto 0) := (others => (others => '0'));
signal diag_cmd_q_clr_log : std_logic_vector(NUM_CHANS*MAX_HEADS-1 downto 0) := (others => '0');
signal diag_cmd_q_wr_count : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)(log2(LOGGER_DEPTH)-2 downto 0) := (others => (others => '0'));
signal fifo_wr_port_pulse : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_wr_port : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal fifo_wr_port_in : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal fifo_rd_port : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal fifo_rd_port_pulse : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_status_empty : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_status_full : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_status_underrun : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_status_overrun : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_controls_clr_fifo : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_controls_clr_errors : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_controls_pop_rd_port : std_logic_vector(NUM_HEADS - 1 downto 0);
signal fifo_rd_addr : bus_array_t(0 to NUM_HEADS - 1)(31 downto 0);
signal fifo_loop_count : bus_array_t(0 to NUM_HEADS - 1)(9 downto 0);
signal ip_id_ip_number : bus_array_t(0 to NUM_HEADS - 1)(7 downto 0);
signal ip_id_mfr_number : bus_array_t(0 to NUM_HEADS - 1)(7 downto 0);
signal ip_ver_minor_number : bus_array_t(0 to NUM_HEADS - 1)(7 downto 0);
signal ip_ver_major_number : bus_array_t(0 to NUM_HEADS - 1)(7 downto 0);
signal dest_port_wr_int : std_logic_vector(MAX_HEADS downto 0);
signal transfer_active : std_logic_vector(MAX_HEADS - 1 downto 0);
-- ID signals
signal ip_id_ip_number : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 7 downto 0);
signal ip_id_mfr_number : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 7 downto 0);
signal ip_ver_minor_number : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 7 downto 0);
signal ip_ver_major_number : bus_array_t(0 to NUM_CHANS*MAX_HEADS-1)( 7 downto 0);
begin
debug_out <= debug_out_int(0);
-- -----------------------------------
-- Data path combinatorial logic
-- -----------------------------------
irq <= '0' when irq_int = std_logic_vector(to_unsigned(0, NUM_HEADS)) else '1';
-- Export debug bus from streamer 0
debug_out <= debug_out_int(0);
dest_port_wr_int(NUM_EXT_DSTS - 1 downto 0) <= dest_port_wr;
dest_port_wr_data <= dest_port_wr_data_int(3) when dest_port_wr_int(3) = '1' else
dest_port_wr_data_int(2) when dest_port_wr_int(2) = '1' else
dest_port_wr_data_int(1) when dest_port_wr_int(1) = '1' else
dest_port_wr_data_int(0);
-- Interrupt on output if any interrupt asserted
irq <= '0' when irq_int = std_logic_vector(to_unsigned(0, NUM_CHANS*MAX_HEADS)) else '1';
dest_port_wr(0) <= dest_port_wr_0(0);
dest_port_wr(NUM_EXT_DSTS - 1) <= dest_port_wr_0(1);
-- Mux the destination output bus from data streamers with an (arbitrary) priority encoding
process (all)
begin
dest_port_wr_data <= dest_port_wr_data_int(0);
dest_port_rdy_0(0) <= dest_port_rdy(0);
dest_port_rdy_0(1) <= dest_port_rdy(NUM_EXT_DSTS - 1);
for i in NUM_CHANS*MAX_HEADS-1 downto 1 loop
if dest_port_wr(i) then
dest_port_wr_data <= dest_port_wr_data_int(i);
end if;
end loop;
end process;
dest_port_last_word <= '1' when unsigned(dest_port_last_word_int) /= 0 else '0';
-- When the number of heads is less than the coonfigured maximum, tie off upper
-- bits of key signals
GEN_TIE_OFF_REQD : if MAX_HEADS > NUM_HEADS generate
GEN_TIE_OFF : for i in NUM_HEADS to MAX_HEADS - 1 generate
avm_rx_read_int(i) <= '0';
dest_port_wr_int(i + 1) <= '0';
transfer_active(i) <= '0';
avs_csr_readdata_int(i) <= (others => '0');
GEN_TIE_OFF : for i in NUM_HEADS to MAX_HEADS-1 generate
avm_rx_read_int(i) <= '0';
avm_rx_read_int(i+MAX_HEADS) <= '0';
transfer_active(i) <= '0';
transfer_active(i+MAX_HEADS) <= '0';
avs_csr_readdata_int(i) <= (others => '0');
avs_csr_readdata_int(i+MAX_HEADS) <= (others => '0');
dest_port_last_word_int(i) <= '0';
dest_port_last_word_int(i+MAX_HEADS) <= '0';
dest_port_wr(i) <= '0';
dest_port_wr(i+MAX_HEADS) <= '0';
avm_rx_burstcount_int(i) <= (others => '0');
avm_rx_burstcount_int(i+MAX_HEADS) <= (others => '0');
avm_rx_address_int(i) <= (others => '0');
avm_rx_address_int(i+MAX_HEADS) <= (others => '0');
dest_port_wr_data_int(i) <= (others => '0');
dest_port_wr_data_int(i+MAX_HEADS) <= (others => '0');
diag_1(i) <= (others => '0');
diag_1(i+MAX_HEADS) <= (others => '0');
diag_2(i) <= (others => '0');
diag_2(i+MAX_HEADS) <= (others => '0');
irq_int(i) <= '0';
irq_int(i+MAX_HEADS) <= '0';
end generate GEN_TIE_OFF;
end generate GEN_TIE_OFF_REQD;
print_streamer_csr_decode_1 : entity work.print_streamer_csr_decode -- @suppress "Generic map uses default values. Missing optional actuals: ADDR_DECODE_HI_BIT, ADDR_DECODE_LO_BIT"
port map(
-- If zero gap support is not required tie off the signals from the uninstantiated zero gap logic
GEN_ZG_TIE_OFF : if NO_ZERO_GAP generate
GEN_ZG_TIE_OFF_LOOP : for i in MAX_HEADS to MAX_HEADS+NUM_HEADS-1 generate
data_streamer_0_write => avs_csr_write_int(0),
data_streamer_0_read => avs_csr_read_int(0),
data_streamer_0_readdata => avs_csr_readdata_int(0),
data_streamer_1_write => avs_csr_write_int(1),
data_streamer_1_read => avs_csr_read_int(1),
data_streamer_1_readdata => avs_csr_readdata_int(1),
data_streamer_2_write => avs_csr_write_int(2),
data_streamer_2_read => avs_csr_read_int(2),
data_streamer_2_readdata => avs_csr_readdata_int(2),
data_streamer_3_write => avs_csr_write_int(3),
data_streamer_3_read => avs_csr_read_int(3),
data_streamer_3_readdata => avs_csr_readdata_int(3),
avs_csr_readdata_int(i) <= (others => '0');
dest_port_last_word_int(i) <= '0';
dest_port_wr(i) <= '0';
avm_rx_burstcount_int(i) <= (others => '0');
dest_port_wr_data_int(i) <= (others => '0');
diag_1(i) <= (others => '0');
diag_2(i) <= (others => '0');
irq_int(i) <= '0';
avs_address => avs_csr_address(5 downto 4),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
end generate;
end generate GEN_ZG_TIE_OFF;
);
-- -----------------------------------
-- Register access address decode
-- -----------------------------------
GEN_PRINT_STREAMER_LOOP : for i in 0 to NUM_HEADS - 1 generate
print_streamer_csr_decode_1 : entity work.print_streamer_csr_decode
generic map (
ADDR_DECODE_HI_BIT => 6,
ADDR_DECODE_LO_BIT => 4
)
port map (
data_streamer_csr_regs_inst : entity work.data_streamer_csr_regs
generic map(
ADDR_DECODE_WIDTH => 4
)
port map(
clk => clk,
rst_n => rst_n,
data_streamer_0_write => avs_csr_write_int(0),
data_streamer_0_read => avs_csr_read_int(0),
data_streamer_0_readdata => avs_csr_readdata_int(0),
data_streamer_1_write => avs_csr_write_int(1),
data_streamer_1_read => avs_csr_read_int(1),
data_streamer_1_readdata => avs_csr_readdata_int(1),
data_streamer_2_write => avs_csr_write_int(2),
data_streamer_2_read => avs_csr_read_int(2),
data_streamer_2_readdata => avs_csr_readdata_int(2),
data_streamer_3_write => avs_csr_write_int(3),
data_streamer_3_read => avs_csr_read_int(3),
data_streamer_3_readdata => avs_csr_readdata_int(3),
control_clear_cmd => control_clear_cmd(i),
control_clear_errors => control_clear_errors(i),
control_msb => control_msb(i),
control_watermark => control_watermark(i),
control_en_acp_window => control_en_acp_window(i),
control_disable => control_disable(i),
control_clr_dst0_count => control_clr_dst0_count(i),
cmd_port_pulse => cmd_port_pulse(i),
cmd_port => cmd_port(i),
cmd_port_in => (others => '0'),
status_queue_space => status_queue_space(i)(5 downto 1),
data_streamer_0_aux_write => avs_csr_write_int(4),
data_streamer_0_aux_read => avs_csr_read_int(4),
data_streamer_0_aux_readdata => avs_csr_readdata_int(4),
data_streamer_1_aux_write => avs_csr_write_int(5),
data_streamer_1_aux_read => avs_csr_read_int(5),
data_streamer_1_aux_readdata => avs_csr_readdata_int(5),
data_streamer_2_aux_write => avs_csr_write_int(6),
data_streamer_2_aux_read => avs_csr_read_int(6),
data_streamer_2_aux_readdata => avs_csr_readdata_int(6),
data_streamer_3_aux_write => avs_csr_write_int(7),
data_streamer_3_aux_read => avs_csr_read_int(7),
data_streamer_3_aux_readdata => avs_csr_readdata_int(7),
status_tlb_mismatch_err => '0',
status_tlb_empty_err => '0',
status_auto_load_err => auto_load_err(i),
status_bad_cmd_err => bad_cmd_err(i),
status_cpu_race_err => cpu_race_err(i),
status_overrun_err => overrun_err(i),
status_auto_cmd_active => auto_cmd_active(i),
status_cmd_depth_log2 => std_logic_vector(to_unsigned(CMD_QUEUE_DEPTH_LOG2, 4)),
status_handle => handle(i),
avs_address => avs_csr_address(6 downto 4),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
avs_readdata => avs_csr_readdata
diags_remain => debug_out_int(i)(11 downto 0),
diags_cmd_pending => debug_out_int(i)(12),
diags_data_active => debug_out_int(i)(13),
diags_cmd_avail => debug_out_int(i)(14),
diags_dst_sel => debug_out_int(i)(18 downto 15),
diags_dst_rdy => debug_out_int(i)(19),
);
curr_cmd => diag_1(i),
curr_param1 => diag_2(i),
dst0_word_count => dst0_word_count(i),
-- -----------------------------------
--Instantiation of streamer channels
-- -----------------------------------
fifo_wr_port_pulse => fifo_wr_port_pulse(i),
fifo_wr_port => fifo_wr_port(i),
fifo_wr_port_in => fifo_wr_port_in(i),
fifo_rd_port => fifo_rd_port(i),
fifo_rd_port_pulse => fifo_rd_port_pulse(i),
fifo_status_empty => fifo_status_empty(i),
fifo_status_full => fifo_status_full(i),
fifo_status_underrun => fifo_status_underrun(i),
fifo_status_overrun => fifo_status_overrun(i),
fifo_status_loop_count => fifo_loop_count(i),
fifo_controls_clr_fifo => fifo_controls_clr_fifo(i),
fifo_controls_clr_errors => fifo_controls_clr_errors(i),
fifo_controls_pop_rd_port => fifo_controls_pop_rd_port(i),
fifo_rd_addr => fifo_rd_addr(i),
GEN_AUX_LOOP : for j in 0 to 1 generate
ip_id_ip_number => ip_id_ip_number(i),
ip_id_mfr_number => ip_id_mfr_number(i),
ip_ver_minor_number => ip_ver_minor_number(i),
ip_ver_major_number => ip_ver_major_number(i),
GEN_PRINT_STREAMER_LOOP : for i in 0 to NUM_HEADS-1 generate
avs_address => avs_csr_address(3 downto 0),
avs_write => avs_csr_write_int(i),
avs_writedata => avs_csr_writedata,
avs_read => avs_csr_read_int(i),
avs_readdata => avs_csr_readdata_int(i)
GEN_ZERO_GAP : if NO_ZERO_GAP = false or j = 0 generate
);
-- ----------------------------------
-- Streamer logger
-- ----------------------------------
GEN_LOGGER : if STREAMER_LOGGER generate
fifo_queue_inst : entity work.streamer_fifo_0
port map(
streamer_log_inst : entity work.streamer_logger_7
generic map (
LOGGER_DEPTH => LOGGER_DEPTH
)
port map (
clk => clk,
rst_n => rst_n,
clk => clk,
rst_n => rst_n,
fifo_wr_port_pulse => fifo_wr_port_pulse(i),
fifo_wr_port => fifo_wr_port(i),
fifo_wr_port_in => fifo_wr_port_in(i),
fifo_rd_port => fifo_rd_port(i),
fifo_rd_port_pulse => fifo_rd_port_pulse(i),
fifo_status_empty => fifo_status_empty(i),
fifo_status_full => fifo_status_full(i),
fifo_status_underrun => fifo_status_underrun(i),
fifo_status_overrun => fifo_status_overrun(i),
fifo_controls_clr_fifo => fifo_controls_clr_fifo(i),
fifo_controls_clr_errors => fifo_controls_clr_errors(i),
fifo_controls_pop_rd_port => fifo_controls_pop_rd_port(i),
fifo_loop_count => fifo_loop_count(i),
wr_req => diag_cmd_q_write(i+j*MAX_HEADS),
wr_data => diag_cmd_q_write_data(i+j*MAX_HEADS),
wr_ptr => diag_cmd_q_wr_count(i+j*MAX_HEADS),
avm_rx_address => avm_rx_address_int(i)(31 downto 28),
avm_rx_read => avm_rx_read_int(i),
avm_rx_waitrequest => avm_rx_waitrequest_int(i),
avm_rx_readdatavalid => avm_rx_readdatavalid_int(i)
rd_addr => diag_cmd_q_rd_addr(i+j*MAX_HEADS),
rd_data_out => diag_cmd_q_read_data(i+j*MAX_HEADS),
clr_logger => diag_cmd_q_clr_log(i+j*MAX_HEADS)
);
);
GEN_DATA_STREAMER0 : if i = 0 generate
end generate;
data_streamer_inst : entity work.data_streamer_7
generic map(
NUM_EXT_DSTS => 2,
CMD_QUEUE_DEPTH => CMD_QUEUE_DEPTH,
EXCLUDE_VIRTUAL_MAPPING_LOGIC => SLIM
-- -----------------------------------
-- Data streamer registers
-- -----------------------------------
data_streamer_csr_regs_inst : entity work.data_streamer_csr_regs
generic map (
ADDR_DECODE_WIDTH => 4
)
port map(
port map (
clk => clk,
rst_n => rst_n,
clk => clk,
rst_n => rst_n,
control_clear_cmd => control_clear_cmd(i+j*MAX_HEADS),
control_clear_errors => control_clear_errors(i+j*MAX_HEADS),
control_msb => control_msb(i+j*MAX_HEADS),
control_watermark => control_watermark(i+j*MAX_HEADS),
control_en_acp_window => control_en_acp_window(i+j*MAX_HEADS),
control_disable => control_disable(i+j*MAX_HEADS),
control_clr_dst0_count => control_clr_dst0_count(i+j*MAX_HEADS),
cmd_port_pulse => cmd_port_pulse(i+j*MAX_HEADS),
cmd_port => cmd_port(i+j*MAX_HEADS),
cmd_port_in => (others => '0'),
control_clear_cmd => control_clear_cmd(i),
control_clear_errors => control_clear_errors(i),
control_msb => control_msb(i),
control_watermark => control_watermark(i),
control_disable => control_disable(i),
control_clr_dst0_count => control_clr_dst0_count(i),
status_queue_space => status_queue_space(i+j*MAX_HEADS)(5 downto 1),
status_auto_load_err => auto_load_err(i+j*MAX_HEADS),
status_bad_cmd_err => bad_cmd_err(i+j*MAX_HEADS),
status_cpu_race_err => cpu_race_err(i+j*MAX_HEADS),
status_overrun_err => overrun_err(i+j*MAX_HEADS),
status_auto_cmd_active => auto_cmd_active(i+j*MAX_HEADS),
status_cmd_depth_log2 => std_logic_vector(to_unsigned(CMD_QUEUE_DEPTH_LOG2, 4)),
status_handle => handle(i+j*MAX_HEADS),
cmd_port_wr => cmd_port_pulse(i),
cmd_port => cmd_port(i),
diags_remain => debug_out_int(i+j*MAX_HEADS)(11 downto 0),
diags_cmd_pending => debug_out_int(i+j*MAX_HEADS)(12),
diags_data_active => debug_out_int(i+j*MAX_HEADS)(13),
diags_cmd_avail => debug_out_int(i+j*MAX_HEADS)(14),
diags_dst_sel => debug_out_int(i+j*MAX_HEADS)(18 downto 15),
diags_dst_rdy => debug_out_int(i+j*MAX_HEADS)(19),
auto_load_err => auto_load_err(i),
bad_cmd_err => bad_cmd_err(i),
cpu_race_err => cpu_race_err(i),
overrun_err => overrun_err(i),
auto_cmd_active => auto_cmd_active(i),
status_queue_space => status_queue_space(i),
handle => handle(i),
diags_logger_wr_ptr => diag_cmd_q_wr_count(i+j*MAX_HEADS),
diag_logger_rdata => diag_cmd_q_read_data(i+j*MAX_HEADS),
avm_rx_waitrequest => avm_rx_waitrequest_int(i),
avm_rx_burstcount => avm_rx_burstcount_int(i),
avm_rx_address => avm_rx_address_int(i),
avm_rx_read => avm_rx_read_int(i),
avm_rx_readdata => avm_rx_readdata_int(i),
avm_rx_readdatavalid => avm_rx_readdatavalid_int(i),
curr_cmd => diag_1(i+j*MAX_HEADS),
curr_param1 => diag_2(i+j*MAX_HEADS),
dest_port_wr => dest_port_wr_0,
dest_port_wr_data => dest_port_wr_data_int(i),
dest_port_rdy => dest_port_rdy_0,
dst0_word_count => dst0_word_count(i+j*MAX_HEADS),
transfer_active => transfer_active(i),
fifo_wr_port_pulse => fifo_wr_port_pulse(i+j*MAX_HEADS),
fifo_wr_port => fifo_wr_port(i+j*MAX_HEADS),
fifo_wr_port_in => fifo_wr_port_in(i+j*MAX_HEADS),
fifo_rd_port => fifo_rd_port(i+j*MAX_HEADS),
fifo_rd_port_pulse => fifo_rd_port_pulse(i+j*MAX_HEADS),
fifo_status_empty => fifo_status_empty(i+j*MAX_HEADS),
fifo_status_full => fifo_status_full(i+j*MAX_HEADS),
fifo_status_underrun => fifo_status_underrun(i+j*MAX_HEADS),
fifo_status_overrun => fifo_status_overrun(i+j*MAX_HEADS),
fifo_status_loop_count => fifo_loop_count(i+j*MAX_HEADS),
fifo_controls_clr_fifo => fifo_controls_clr_fifo(i+j*MAX_HEADS),
fifo_controls_clr_errors => fifo_controls_clr_errors(i+j*MAX_HEADS),
fifo_controls_pop_rd_port => fifo_controls_pop_rd_port(i+j*MAX_HEADS),
fifo_rd_addr => fifo_rd_addr(i+j*MAX_HEADS),
irq => irq_int(i),
ip_id_ip_number => ip_id_ip_number(i+j*MAX_HEADS),
ip_id_mfr_number => ip_id_mfr_number(i+j*MAX_HEADS),
ip_ver_minor_number => ip_ver_minor_number(i+j*MAX_HEADS),
ip_ver_major_number => ip_ver_major_number(i+j*MAX_HEADS),
ld_q_redirect_addr => fifo_rd_addr(i),
ip_id_ip_number => ip_id_ip_number(i),
ip_id_mfr_number => ip_id_mfr_number(i),
ip_ver_minor_number => ip_ver_minor_number(i),
ip_ver_major_number => ip_ver_major_number(i),
debug_out => debug_out_int(i),
diag_dst0_count => dst0_word_count(i),
diag_1 => diag_1(i),
diag_2 => diag_2(i)
);
end generate GEN_DATA_STREAMER0;
GEN_DATA_STREAMER : if i /= 0 generate
data_streamer_inst : entity work.data_streamer_7
generic map(
NUM_EXT_DSTS => 1,
CMD_QUEUE_DEPTH => CMD_QUEUE_DEPTH,
EXCLUDE_VIRTUAL_MAPPING_LOGIC => SLIM
)
port map(
clk => clk,
rst_n => rst_n,
control_clear_cmd => control_clear_cmd(i),
control_clear_errors => control_clear_errors(i),
control_msb => control_msb(i),
control_watermark => control_watermark(i),
control_disable => control_disable(i),
control_clr_dst0_count => control_clr_dst0_count(i),
cmd_port_wr => cmd_port_pulse(i),
cmd_port => cmd_port(i),
auto_load_err => auto_load_err(i),
bad_cmd_err => bad_cmd_err(i),
cpu_race_err => cpu_race_err(i),
overrun_err => overrun_err(i),
auto_cmd_active => auto_cmd_active(i),
status_queue_space => status_queue_space(i),
handle => handle(i),
avm_rx_waitrequest => avm_rx_waitrequest_int(i),
avm_rx_burstcount => avm_rx_burstcount_int(i),
avm_rx_address => avm_rx_address_int(i),
avm_rx_read => avm_rx_read_int(i),
avm_rx_readdata => avm_rx_readdata_int(i),
avm_rx_readdatavalid => avm_rx_readdatavalid_int(i),
dest_port_wr => dest_port_wr(i downto i),
dest_port_wr_data => dest_port_wr_data_int(i),
dest_port_rdy => dest_port_rdy(i downto i),
transfer_active => transfer_active(i),
irq => irq_int(i),
ld_q_redirect_addr => fifo_rd_addr(i),
ip_id_ip_number => ip_id_ip_number(i),
ip_id_mfr_number => ip_id_mfr_number(i),
ip_ver_minor_number => ip_ver_minor_number(i),
ip_ver_major_number => ip_ver_major_number(i),
debug_out => debug_out_int(i),
diag_dst0_count => dst0_word_count(i),
diag_1 => diag_1(i),
diag_2 => diag_2(i)
avs_address => avs_csr_address(3 downto 0),
avs_write => avs_csr_write_int(i+j*MAX_HEADS),
avs_writedata => avs_csr_writedata,
avs_read => avs_csr_read_int(i+j*MAX_HEADS),
avs_readdata => avs_csr_readdata_int(i+j*MAX_HEADS)
);
end generate GEN_DATA_STREAMER;
-- -----------------------------------
-- Streamer indirection FIFO
-- -----------------------------------
end generate GEN_PRINT_STREAMER_LOOP;
fifo_queue_inst : entity work.streamer_fifo_0
port map (
clk => clk,
rst_n => rst_n,
fifo_wr_port_pulse => fifo_wr_port_pulse(i+j*MAX_HEADS),
fifo_wr_port => fifo_wr_port(i+j*MAX_HEADS),
fifo_wr_port_in => fifo_wr_port_in(i+j*MAX_HEADS),
fifo_rd_port => fifo_rd_port(i+j*MAX_HEADS),
fifo_rd_port_pulse => fifo_rd_port_pulse(i+j*MAX_HEADS),
fifo_status_empty => fifo_status_empty(i+j*MAX_HEADS),
fifo_status_full => fifo_status_full(i+j*MAX_HEADS),
fifo_status_underrun => fifo_status_underrun(i+j*MAX_HEADS),
fifo_status_overrun => fifo_status_overrun(i+j*MAX_HEADS),
fifo_controls_clr_fifo => fifo_controls_clr_fifo(i+j*MAX_HEADS),
fifo_controls_clr_errors => fifo_controls_clr_errors(i+j*MAX_HEADS),
fifo_controls_pop_rd_port => fifo_controls_pop_rd_port(i+j*MAX_HEADS),
fifo_loop_count => fifo_loop_count(i+j*MAX_HEADS),
avm_rx_address => avm_rx_address_int(i+j*MAX_HEADS)(31 downto 28),
avm_rx_read => avm_rx_read_int(i+j*MAX_HEADS),
avm_rx_waitrequest => avm_rx_waitrequest_int(i+j*MAX_HEADS),
avm_rx_readdatavalid => avm_rx_readdatavalid_int(i+j*MAX_HEADS)
);
-- -----------------------------------
-- Data streamer logic
-- -----------------------------------
data_streamer_inst : entity work.data_streamer_7
generic map(
NUM_EXT_DSTS => 1,
CMD_QUEUE_DEPTH => CMD_QUEUE_DEPTH,
EXCLUDE_VIRTUAL_MAPPING_LOGIC => true
)
port map(
clk => clk,
rst_n => rst_n,
control_clear_cmd => control_clear_cmd(i+j*MAX_HEADS),
control_clear_errors => control_clear_errors(i+j*MAX_HEADS),
control_msb => control_msb(i+j*MAX_HEADS),
control_watermark => control_watermark(i+j*MAX_HEADS),
control_disable => control_disable(i+j*MAX_HEADS),
control_clr_dst0_count => control_clr_dst0_count(i+j*MAX_HEADS),
cmd_port_wr => cmd_port_pulse(i+j*MAX_HEADS),
cmd_port => cmd_port(i+j*MAX_HEADS),
auto_load_err => auto_load_err(i+j*MAX_HEADS),
bad_cmd_err => bad_cmd_err(i+j*MAX_HEADS),
cpu_race_err => cpu_race_err(i+j*MAX_HEADS),
overrun_err => overrun_err(i+j*MAX_HEADS),
auto_cmd_active => auto_cmd_active(i+j*MAX_HEADS),
status_queue_space => status_queue_space(i+j*MAX_HEADS),
handle => handle(i+j*MAX_HEADS),
avm_rx_waitrequest => avm_rx_waitrequest_int(i+j*MAX_HEADS),
avm_rx_burstcount => avm_rx_burstcount_int(i+j*MAX_HEADS),
avm_rx_address => avm_rx_address_int(i+j*MAX_HEADS),
avm_rx_read => avm_rx_read_int(i+j*MAX_HEADS),
avm_rx_readdata => avm_rx_readdata_int(i+j*MAX_HEADS),
avm_rx_readdatavalid => avm_rx_readdatavalid_int(i+j*MAX_HEADS),
dest_port_wr => dest_port_wr(i+j*MAX_HEADS downto i+j*MAX_HEADS),
dest_port_wr_data => dest_port_wr_data_int(i+j*MAX_HEADS),
dest_port_rdy => dest_port_rdy(i+j*MAX_HEADS downto i+j*MAX_HEADS),
dest_port_last_word => dest_port_last_word_int(i+j*MAX_HEADS),
ip_id_ip_number => ip_id_ip_number(i+j*MAX_HEADS),
ip_id_mfr_number => ip_id_mfr_number(i+j*MAX_HEADS),
ip_ver_minor_number => ip_ver_minor_number(i+j*MAX_HEADS),
ip_ver_major_number => ip_ver_major_number(i+j*MAX_HEADS),
transfer_active => transfer_active(i+j*MAX_HEADS),
irq => irq_int(i+j*MAX_HEADS),
ld_q_redirect_addr => fifo_rd_addr(i+j*MAX_HEADS),
debug_out => debug_out_int(i+j*MAX_HEADS),
diag_dst0_count => dst0_word_count(i+j*MAX_HEADS),
diag_1 => diag_1(i+j*MAX_HEADS),
diag_2 => diag_2(i+j*MAX_HEADS),
diag_cmd_q_write => diag_cmd_q_write(i+j*MAX_HEADS),
diag_cmd_q_write_data => diag_cmd_q_write_data(i+j*MAX_HEADS)
);
end generate GEN_ZERO_GAP;
GEN_NO_ZERO_GAP : if NO_ZERO_GAP and j = 1 generate
transfer_active(i+MAX_HEADS) <= '0';
auto_cmd_active(i+MAX_HEADS) <= '0';
avm_rx_read_int(i+MAX_HEADS) <= '0';
end generate GEN_NO_ZERO_GAP;
end generate GEN_PRINT_STREAMER_LOOP;
end generate GEN_AUX_LOOP;
-- -----------------------------------
-- Memory arbitration
-- -----------------------------------
mem_arbiter_inst : entity work.mem_arbiter
generic map(
NUM_HEADS => MAX_HEADS -- arbiter always for the maximim
)
port map(
generic map(
NUM_PORTS => MAX_HEADS*2
)
port map(
clk => clk,
rst_n => rst_n,
clk => clk,
rst_n => rst_n,
transfer_active => transfer_active,
avm_rx_waitrequest_in => avm_rx_waitrequest_int,
avm_rx_burstcount_in => avm_rx_burstcount_int,
avm_rx_address_in => avm_rx_address_int,
avm_rx_read_in => avm_rx_read_int,
avm_rx_readdata_in => avm_rx_readdata_int,
avm_rx_readdatavalid_in => avm_rx_readdatavalid_int,
transfer_active => transfer_active,
avm_rx_waitrequest_in => avm_rx_waitrequest_int,
avm_rx_burstcount_in => avm_rx_burstcount_int,
avm_rx_address_in => avm_rx_address_int,
avm_rx_read_in => avm_rx_read_int,
avm_rx_readdata_in => avm_rx_readdata_int,
avm_rx_readdatavalid_in => avm_rx_readdatavalid_int,
avm_rx_waitrequest => avm_rx_waitrequest_arb,
avm_rx_burstcount => avm_rx_burstcount_arb,
avm_rx_address => avm_rx_address_arb,
avm_rx_read => avm_rx_read_arb,
avm_rx_readdata => avm_rx_readdata_arb,
avm_rx_readdatavalid => avm_rx_readdatavalid_arb
avm_rx_waitrequest => avm_rx_waitrequest_arb,
avm_rx_burstcount => avm_rx_burstcount_arb,
avm_rx_address => avm_rx_address_arb,
avm_rx_read => avm_rx_read_arb,
avm_rx_readdata => avm_rx_readdata_arb,
avm_rx_readdatavalid => avm_rx_readdatavalid_arb
);
);
avm_to_axi_master_inst : entity work.avm_to_axi_master -- @suppress "Generic map uses default values. Missing optional actuals: ARUSER, ARCACHE"
port map(
-- -----------------------------------
-- Avalon to AXI-4 adapter
-- -----------------------------------
en_acp_window => control_en_acp_window(0),
avm_to_axi_master_inst : entity work.avm_to_axi_master
port map (
axm_awaddr => axm_awaddr,
axm_awprot => axm_awprot,
axm_awvalid => axm_awvalid,
axm_awready => axm_awready,
en_acp_window => control_en_acp_window(0),
axm_wdata => axm_wdata,
axm_wlast => axm_wlast,
axm_wvalid => axm_wvalid,
axm_wready => axm_wready,
axm_awaddr => axm_awaddr,
axm_awprot => axm_awprot,
axm_awvalid => axm_awvalid,
axm_awready => axm_awready,
axm_bvalid => axm_bvalid,
axm_bready => axm_bready,
axm_wdata => axm_wdata,
axm_wlast => axm_wlast,
axm_wvalid => axm_wvalid,
axm_wready => axm_wready,
axm_araddr => axm_araddr,
axm_arlen => axm_arlen,
axm_arsize => axm_arsize,
axm_arburst => axm_arburst,
axm_arcache => axm_arcache,
axm_aruser => axm_aruser,
axm_arprot => axm_arprot,
axm_arvalid => axm_arvalid,
axm_arready => axm_arready,
axm_bvalid => axm_bvalid,
axm_bready => axm_bready,
axm_rdata => axm_rdata,
axm_rvalid => axm_rvalid,
axm_rready => axm_rready,
axm_araddr => axm_araddr,
axm_arlen => axm_arlen,
axm_arsize => axm_arsize,
axm_arburst => axm_arburst,
axm_arcache => axm_arcache,
axm_aruser => axm_aruser,
axm_arprot => axm_arprot,
axm_arvalid => axm_arvalid,
axm_arready => axm_arready,
avm_rx_waitrequest => avm_rx_waitrequest_arb,
axm_rdata => axm_rdata,
axm_rvalid => axm_rvalid,
axm_rready => axm_rready,
avm_rx_burstcount1 => avm_rx_burstcount,
avm_rx_address1 => avm_rx_address,
avm_rx_read1 => avm_rx_read,
avm_rx_waitrequest => avm_rx_waitrequest_arb,
avm_rx_burstcount => avm_rx_burstcount_arb,
avm_rx_address => avm_rx_address_arb,
avm_rx_read => avm_rx_read_arb,
avm_rx_readdata => avm_rx_readdata_arb,
avm_rx_readdatavalid => avm_rx_readdatavalid_arb
avm_rx_burstcount0 => avm_rx_burstcount_arb,
avm_rx_address0 => avm_rx_address_arb,
avm_rx_read0 => avm_rx_read_arb,
avm_rx_readdata => avm_rx_readdata_arb,
avm_rx_readdatavalid => avm_rx_readdatavalid_arb
);
avm_rx_waitrequest <= avm_rx_waitrequest_arb;
avm_rx_readdata <= avm_rx_readdata_arb;
avm_rx_readdatavalid <= avm_rx_readdatavalid_arb;
);
end architecture;
end architecture;

View file

@ -3,6 +3,7 @@
"bus" : "csr",
"addr_hi_bit" : "5",
"addr_lo_bit" : "4",
"addr_width" : "4",
"description" : "This block is the print unit for the GMA SOM board soft IP",
"sub_blocks" : {
"generic_sequencer_15:a" : {
@ -16,9 +17,115 @@
"offset" : "0x10"
},
"generic_delay_queue_1" : {
"instance" : "",
"instance" : "0",
"process" : "enabled",
"offset" : "0x20"
},
"local" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x30"
}
},
"registers" : {
"ip_id" : {
"address" : "0",
"width" : "32",
"description" : "Unique ID for this IP block",
"fields" : {
"ip_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x10",
"description" : "IP identifier number"
},
"mfr_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x06",
"description" : "Manufacturer number"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"ip_ver" : {
"address" : "1",
"width" : "32",
"description" : "Bits[7:0] = Minor version number, Bits[15:8] = Major version number, etc.",
"fields" : {
"minor_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x02",
"description" : "Minor number"
},
"major_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x00",
"description" : "Major number"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"fire_req_count0" : {
"address" : "5",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Fire request count for channel 0."
},
"fire_req_count1" : {
"address" : "6",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Fire request count for channel 1."
},
"fire_start_img_count0" : {
"address" : "7",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Start image count for channel 0."
},
"fire_start_img_count1" : {
"address" : "8",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Start image count for channel 1."
},
"last_stripe_count0" : {
"address" : "9",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Last stripe count for channel 0."
},
"last_stripe_count1" : {
"address" : "10",
"type" : "r",
"width" : "32",
"reset" : "0x00",
"description" : "Last stripe count for channel 1."
},
"chan_active" : {
"address" : "11",
"type" : "r",
"width" : "2",
"reset" : "0x00",
"description" : "Channel active state for pixel buffer inline-merge logic"
}
}
},

View file

@ -19,17 +19,21 @@
--! @li pixel_* : Pixel buffer write interface inputs
--! @li fire_* : Timing fire request input
--! @li stm8_trigger_rx : STM8 measurement trigger output
--! @li en_dual_data_path : Enable inline merge dual path (if configured for dual path)
--! @li seq_dac_data_* : DAC data output, muxed with adjacent head in parent to form DAC data output
--! @li wav_*_ext : External wave trigger input
--! @li chan_en : print channel enable input
--! @li bpp_mode : bits per pixel mode input
--! @li print_data_width : Select the print data with (number of active DIN shift inputs of head).
--! @li clear_buffer : Pixel buffer clear pulse signal input
--! @li empty : Data core empty status output
--! @li full : Data core full (with look-ahead) status output
--! @li overrun : Pixel buffer overrun error status
--! @li underrun : Pixel buffer underrun error status
--! @li fp_drop : Fire pulse drop seen
--! @li dbl_drop : Double fire pulse 'droppy' error status
--! @li overlap_error : In line merge overlap error flag
--! @li fire_* : Timing fire request input
--! @li clear_buffer : Pixel buffer clear pulse signal input
--! @li cpu_gl_map_en : Enable input for CPU control of GL mapping
--! @li cpu_gl_map : CPU value for GL mapping
@ -40,6 +44,9 @@
--! @li print_latch : LATCH control output to head
--! @li print_clk : CLK output to head
--! @li print_data : DATA output to head
--! @li diag_peek_* : Pixel buffer access interface
--! @li diag_word_* : Pixel buffer diagnostic word count
--! @li debug_out : Debug signal output port
--!
--! @b Clock-crossing considerations:
--! @li Module is a single clock domain synchronous block
@ -47,18 +54,18 @@
--! @b Language build standard requirements:
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2018 Global Inkjet Systems
--! @date 2018-1-10
--! @author Dave Steele
--! @copyright (c) 2024 Global Inkjet Systems
--! @date 2024-1-10
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.common_pkg.all;
use work.pixel_buffer_2_pkg.all;
entity print_unit is
generic(
@ -68,74 +75,101 @@ entity print_unit is
MAX_OP_WIDTH : natural range 1 to 48 := 48;
MAX_BPP : integer := 3;
SHIFT_DEPTH : integer range 1 to 1024 := 128;
NO_ZERO_GAP : boolean := false;
EN_PEEK : boolean := false;
NUM_CHANS : integer range 1 to 4 := 2; -- number of PD inline-merge channels
PCLK_CLK_RATIO : integer range 1 to 32 := 8
);
port(
clk : in std_logic;
rst_n : in std_logic;
clk : in std_logic;
rst_n : in std_logic;
avs_csr_address : in std_logic_vector(5 downto 0);
avs_csr_write : in std_logic;
avs_csr_writedata : in std_logic_vector(31 downto 0);
avs_csr_read : in std_logic;
avs_csr_readdata : out std_logic_vector(31 downto 0);
avs_csr_address : in std_logic_vector( 5 downto 0);
avs_csr_write : in std_logic;
avs_csr_writedata : in std_logic_vector(31 downto 0);
avs_csr_read : in std_logic;
avs_csr_readdata : out std_logic_vector(31 downto 0);
avs_seq_address : in std_logic_vector(9 downto 0);
avs_seq_write : in std_logic;
avs_seq_writedata : in std_logic_vector(31 downto 0);
avs_seq_read : in std_logic;
avs_seq_readdata : out std_logic_vector(31 downto 0);
avs_seq_address : in std_logic_vector( 9 downto 0);
avs_seq_write : in std_logic;
avs_seq_writedata : in std_logic_vector(31 downto 0);
avs_seq_read : in std_logic;
avs_seq_readdata : out std_logic_vector(31 downto 0);
pixel_buf_wr : in std_logic;
pixel_buf_wr_data : in std_logic_vector(31 downto 0);
pixel_buf_rdy : out std_logic;
pixel_buf_wr : in std_logic;
pixel_buf_wr_data : in std_logic_vector(31 downto 0);
pixel_buf_rdy : out std_logic;
pixel_buf_last_word : in std_logic;
all_on_emul : in std_logic;
chan_en : in std_logic;
bpp_mode : in std_logic_vector(1 downto 0);
print_data_width : in std_logic_vector(5 downto 0);
clear_buffer : in std_logic;
empty : out std_logic;
full : out std_logic;
overrun : out std_logic;
underrun : out std_logic;
fp_drop : out std_logic;
dbl_drop : out std_logic;
pixel_buf_wr_aux : in std_logic;
pixel_buf_wr_data_aux : in std_logic_vector(31 downto 0);
pixel_buf_rdy_aux : out std_logic;
pixel_buf_last_word_aux : in std_logic;
fire_req : in std_logic;
fire_data : in std_logic_vector(7 downto 0);
en_dual_data_path : in std_logic;
all_on_emul : in std_logic;
chan_en : in std_logic;
bpp_mode : in std_logic_vector(1 downto 0);
print_data_width : in std_logic_vector(5 downto 0);
clear_buffer : in std_logic;
empty : out std_logic;
full : out std_logic;
overrun : out std_logic;
underrun : out std_logic;
fp_drop : out std_logic;
dbl_drop : out std_logic;
overlap_error : out std_logic;
cpu_gl_map : in std_logic_vector(7 downto 0);
cpu_gl_map_en : in std_logic;
px_buf_ch_nactive : out std_logic_vector(NUM_CHANS-1 downto 0);
cpu_data_start : in std_logic;
cpu_data_start_first : in std_logic;
cpu_data_start_last : in std_logic;
cpu_start_dly_head : in std_logic_vector(7 downto 0);
cpu_adc_meas : in std_logic;
fire_req : in std_logic;
fire_req_start_merge : in std_logic;
fire_data : in std_logic_vector( 7 downto 0);
stm8_trigger_rx : out std_logic;
sig_seq_force_dacs_0v : in std_logic;
dac_0v_value : in std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
cpu_gl_map : in std_logic_vector(7 downto 0);
cpu_gl_map_en : in std_logic;
cpu_fire_req_start_merge : in std_logic;
cpu_fire_req_pulse : in std_logic;
wave_req_ext : in std_logic;
wave_addr_ext : in std_logic_vector(7 downto 0);
wave_delay_ext : in std_logic_vector(11 downto 0);
cpu_start_seq_go : in std_logic;
cpu_start_seq_address : in std_logic_vector( 7 downto 0);
seq_dac_data : out std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
wave_seq_busy : out std_logic;
print_seq_busy : out std_logic;
cpu_data_start : in std_logic;
cpu_data_start_first : in std_logic;
cpu_data_start_last : in std_logic;
cpu_start_dly_head : in std_logic_vector(7 downto 0);
cpu_adc_meas : in std_logic;
print_clk : out std_logic_vector(0 downto 0);
print_data : out std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
stm8_trigger_rx : out std_logic;
sig_seq_force_dacs_0v : in std_logic;
dac_0v_value : in std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
print_all_on : out std_logic;
print_latch : out std_logic;
wave_req_ext : in std_logic;
wave_addr_ext : in std_logic_vector(7 downto 0);
wave_delay_ext : in std_logic_vector(11 downto 0);
diag_word_count : out std_logic_vector(6 downto 0);
seq_dac_data : out std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
wave_seq_busy : out std_logic;
print_seq_busy : out std_logic;
debug_out : out std_logic_vector(3 downto 0)
print_clk : out std_logic_vector(0 downto 0);
print_data : out std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
print_all_on : out std_logic;
print_latch : out std_logic;
diag_peek_sel : in std_logic;
diag_peek_addr : in std_logic_vector(31 downto 0);
diag_peek_data : out std_logic_vector(31 downto 0);
diag_peek_rdptr : out std_logic_vector( 7 downto 0);
diag_peek_wrptr : out std_logic_vector( 7 downto 0);
diag_peek_wdata : in std_logic_vector(31 downto 0);
diag_peek_wr : in std_logic;
diag_word_count : out std_logic_vector(6 downto 0);
debug_out : out std_logic_vector(3 downto 0)
);
end entity print_unit;
@ -159,29 +193,29 @@ architecture rtl of print_unit is
-- setting the GL mapping and the start bit with delay (sent via delay queue
-- in data core).
subtype GL_REMAP_BITS is natural range 7 downto 0;
constant GL_REMAP_UPDATE_BIT : integer := 8;
constant GL_REMAP_UPDATE_BIT : integer := 8;
subtype START_DLY_BITS is natural range START_DLY_WIDTH + 9 - 1 downto 9;
constant START_DLY_REQ_BIT : integer := START_DLY_WIDTH + 9;
constant START_DLY_FIRST_BIT : integer := START_DLY_WIDTH + 10;
constant START_DLY_LAST_BIT : integer := START_DLY_WIDTH + 11;
constant START_DLY_REQ_BIT : integer := START_DLY_WIDTH + 9;
constant START_DLY_FIRST_BIT : integer := START_DLY_WIDTH + 10;
constant START_DLY_LAST_BIT : integer := START_DLY_WIDTH + 11;
subtype RSVD_BITS is natural range START_DLY_WIDTH + 14 downto START_DLY_WIDTH + 12; -- @suppress "Unused declaration" : helps clarity
constant SEQ_BURST_WORD2_BIT : integer := START_DLY_WIDTH + 15;
constant SEQ_BUS_WIDTH : integer := START_DLY_WIDTH + 16;
constant SEQ_HOLD_OFF_SEL_BIT : integer := START_DLY_WIDTH + 15;
constant SEQ_BUS_WIDTH : integer := START_DLY_WIDTH + 16;
signal avs_csr_write_seq_wave : std_logic;
signal avs_csr_read_seq_wave : std_logic;
signal avs_csr_rdata_seq_wave : std_logic_vector(31 downto 0);
signal avs_csr_write_seq_wave : std_logic;
signal avs_csr_read_seq_wave : std_logic;
signal avs_csr_rdata_seq_wave : std_logic_vector(31 downto 0);
signal avs_seq_write_seq_wave : std_logic;
signal avs_seq_read_seq_wave : std_logic;
signal avs_seq_read_seq_wave_dly : std_logic;
signal avs_seq_rdata_seq_wave : std_logic_vector(31 downto 0);
signal avs_seq_rdata_seq_wave_int : std_logic_vector(31 downto 0);
signal avs_seq_write_seq_wave : std_logic;
signal avs_seq_read_seq_wave : std_logic;
signal avs_seq_read_seq_wave_dly : std_logic;
signal avs_seq_rdata_seq_wave : std_logic_vector(31 downto 0);
signal avs_seq_rdata_seq_wave_int : std_logic_vector(31 downto 0);
signal avs_csr_write_seq_print : std_logic;
signal avs_csr_read_seq_print : std_logic;
signal avs_csr_rdata_seq_print : std_logic_vector(31 downto 0);
signal avs_csr_write_seq_print : std_logic;
signal avs_csr_read_seq_print : std_logic;
signal avs_csr_rdata_seq_print : std_logic_vector(31 downto 0);
signal avs_seq_write_seq_print : std_logic;
signal avs_seq_read_seq_print : std_logic;
@ -189,65 +223,106 @@ architecture rtl of print_unit is
signal avs_seq_rdata_seq_print : std_logic_vector(31 downto 0);
signal avs_seq_rdata_seq_print_int : std_logic_vector(31 downto 0);
signal avs_csr_write_dly : std_logic;
signal avs_csr_read_dly : std_logic;
signal avs_csr_rdata_dly : std_logic_vector(31 downto 0);
signal wave_req_dly : std_logic;
signal wave_addr_dly : std_logic_vector(7 downto 0);
signal wave_req_dly : std_logic;
signal wave_addr_dly : std_logic_vector(7 downto 0);
signal vector_out : std_logic_vector(VECTOR_WIDTH - 1 downto 0);
signal stm8_trigger_rx_int : std_logic;
signal vector_out : std_logic_vector(VECTOR_WIDTH - 1 downto 0);
signal stm8_trigger_rx_int : std_logic;
signal trig_count : std_logic_vector(7 downto 0);
signal stm8_trigger_rx_int_d : std_logic;
signal trig_count : std_logic_vector(7 downto 0);
signal stm8_trigger_rx_int_d : std_logic;
signal wav_trigger_in : std_logic_vector(TRIGGER_WIDTH - 1 downto 0);
signal wav_trigger_in : std_logic_vector(TRIGGER_WIDTH - 1 downto 0);
signal vector_print : std_logic_vector(18 downto 0);
signal vector_print : std_logic_vector(18 downto 0);
signal wave_req : std_logic;
signal wave_addr : std_logic_vector(7 downto 0);
signal wave_delay : std_logic_vector(11 downto 0);
signal wave_req : std_logic;
signal wave_addr : std_logic_vector(7 downto 0);
signal wave_delay : std_logic_vector(11 downto 0);
signal wave_req_int : std_logic;
signal wave_addr_int : std_logic_vector(5 downto 0);
signal wave_delay_int : std_logic_vector(11 downto 0);
signal wave_req_int : std_logic;
signal wave_addr_int : std_logic_vector(5 downto 0);
signal wave_delay_int : std_logic_vector(11 downto 0);
signal seq_data_config : std_logic_vector(SEQ_BUS_WIDTH - 1 downto 0);
signal seq_data_valid : std_logic;
signal seq_data_ack : std_logic;
signal seq_data_config : std_logic_vector(SEQ_BUS_WIDTH - 1 downto 0);
signal seq_data_valid : std_logic;
signal seq_data_ack : std_logic;
signal seq_dac_data_int : std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
signal seq_dac_data_int : std_logic_vector(DAC_DATA_WIDTH - 1 downto 0);
signal seq_start_req_int : std_logic;
signal seq_start_first_pulse_int : std_logic;
signal seq_start_last_pulse_int : std_logic;
signal seq_start_delay_int : std_logic_vector(START_DLY_WIDTH - 1 downto 0);
signal seq_start_req_int : std_logic;
signal seq_start_req_first_int : std_logic;
signal seq_start_req_last_int : std_logic;
signal fire_req_held_off : std_logic;
signal sequencers_busy : std_logic;
signal seq_gl_map_update : std_logic;
signal seq_fp_holdoff_update : std_logic;
signal print_seq_trig : std_logic_vector(1 downto 0);
signal fire_req_int : std_logic;
signal sequencers_busy : std_logic;
signal print_seq_start : std_logic;
signal print_seq_start_addr : std_logic_vector( 8 downto 0);
signal pulse_count : std_logic_vector(11 downto 0);
signal pulse4096 : std_logic;
signal pulse_reset : std_logic;
signal pulse_reset_last : std_logic;
signal seq_gl_map_update : std_logic;
signal seq_fp_holdoff_update : std_logic;
signal print_seq_trig : std_logic_vector(1 downto 0);
signal print_data_i : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal print_all_on_i : std_logic;
signal print_clk_i : std_logic_vector(0 downto 0);
signal allon_reg : std_logic_vector(3 downto 0);
signal allon_cnt : std_logic_vector(log2(SHIFT_DEPTH) + log2(PCLK_CLK_RATIO) downto 0);
signal allon_pclk : std_logic;
signal allon_mux : std_logic;
signal fire_req_int : std_logic;
signal fire_req_int_d : std_logic;
signal drop_stripe : std_logic;
signal fire_req_start_merge_int : std_logic;
signal delay_queue_write : std_logic;
signal delay_queue_read : std_logic;
signal delay_queue_readdata : std_logic_vector(31 downto 0);
signal local_write : std_logic;
signal local_read : std_logic;
signal local_readdata : std_logic_vector(31 downto 0);
signal chan_active : std_logic_vector(NUM_CHANS-1 downto 0);
signal pulse_count : std_logic_vector(11 downto 0);
signal pulse4096 : std_logic;
signal pulse_reset : std_logic;
signal pulse_reset_last : std_logic;
signal print_data_i : std_logic_vector(MAX_OP_WIDTH - 1 downto 0);
signal print_all_on_i : std_logic;
signal print_clk_i : std_logic_vector(0 downto 0);
signal allon_reg : std_logic_vector(3 downto 0);
signal allon_cnt : std_logic_vector(log2(SHIFT_DEPTH) + log2(PCLK_CLK_RATIO) downto 0);
signal allon_pclk : std_logic;
signal allon_mux : std_logic;
signal diag_fire_req_count : data_array_t(1 downto 0)(31 downto 0);
signal diag_fire_simg_count : data_array_t(1 downto 0)(31 downto 0);
signal diag_last_stripe_count : data_array_t(1 downto 0)(31 downto 0);
begin
-- -----------------------------------------------
-- Combinatorial logic
-- -----------------------------------------------
chan_active <= not px_buf_ch_nactive;
-- Place holder for debug signals
debug_out <= "00" & wave_req & wave_req_dly;
-- Merge fire request from FPM and from CPU registers
fire_req_int <= '1' when fire_req /= '0' or cpu_fire_req_pulse = '1' else '0';
drop_stripe <= (fire_req or cpu_fire_req_pulse) and sequencers_busy; -- Ensure pixel buffer and print sequencer are tied together to both drop or neither drop
fire_req_start_merge_int <= cpu_fire_req_start_merge when cpu_fire_req_pulse else fire_req_start_merge;
-- Merge sequencer start address from CPU registers and internal logic.
print_seq_start <= (fire_req_int or cpu_start_seq_go) and not sequencers_busy and not print_seq_busy;
print_seq_start_addr <= "0" & cpu_start_seq_address when cpu_start_seq_go else
"0" & fire_data;
-- Pulse creation from wave requests
-- Generate the update pulses for sequence state off of the print data sequencer's burst bus
seq_fp_holdoff_update <= seq_data_valid and seq_data_config(SEQ_HOLD_OFF_SEL_BIT);
seq_gl_map_update <= seq_data_valid and seq_data_config(GL_REMAP_UPDATE_BIT) and not seq_data_config(SEQ_HOLD_OFF_SEL_BIT);
-- Allow firing of data core from CPU if requested, else comes from the wave sequencer.
seq_start_req_int <= seq_data_config(START_DLY_REQ_BIT) when seq_data_valid = '1' and seq_data_config(SEQ_HOLD_OFF_SEL_BIT) = '0' else cpu_data_start;
seq_start_first_pulse_int <= (cpu_data_start and cpu_data_start_first) or (seq_data_config(START_DLY_FIRST_BIT) and seq_data_valid and not seq_data_config(SEQ_HOLD_OFF_SEL_BIT));
seq_start_last_pulse_int <= (cpu_data_start and cpu_data_start_last) or (seq_data_config(START_DLY_LAST_BIT) and seq_data_valid and not seq_data_config(SEQ_HOLD_OFF_SEL_BIT));
-- Make this constant, triggering on bit 0 all the time
wav_trigger_in <= std_logic_vector(to_unsigned(0, TRIGGER_WIDTH - 2)) & pulse4096 & '1';
@ -260,8 +335,29 @@ begin
print_latch <= vector_out(PRINT_LATCH_BIT);
pulse_reset <= vector_out(RESET_TICK_BIT);
-- Inject head clock cycles on rising edge of all_on, but only if all_on_emul(ation) is high
-- Assumption is that HMB will be operated with all_on_emul true, and waveform sequences setting
-- -----------------------------------------------
-- Hold fire requests
-- -----------------------------------------------
HOLD_FIRE_REQ: process (rst_n, clk)
begin
if rst_n = '0' then
fire_req_held_off <= '0';
fire_req_int_d <= '0';
elsif clk'event and clk = '1' then
fire_req_int_d <= fire_req_int;
if fire_req_int_d = '0' and fire_req_int = '1' then
fire_req_held_off <= '1';
elsif print_seq_start = '1' then
fire_req_held_off <= '0';
end if;
end if;
end process;
-- Inject head clock cycles on rising edge of all_on, but only if all_on_emul(ation) is high
-- Assumption is that HMB will be operated with all_on_emul true, and waveform sequences setting
-- print_all_on high at the end of each waveform to trigger loading of ones ready for any spitting that might be needed.
INJECT_ALLON : process(rst_n, clk)
begin
@ -346,16 +442,22 @@ begin
pulse4096 <= '0';
if unsigned(pulse_count) = 0 then
if unsigned(pulse_count) = 4095 then
pulse4096 <= '1';
end if;
end if;
end process;
-- -----------------------------------------------
-- CSR bus address decode
-- -----------------------------------------------
-- Auto-generated Avalon CSR bus decoder block
print_unit_csr_decode_1 : entity work.print_unit_csr_decode
port map(
print_unit_csr_decode_inst : entity work.print_unit_csr_decode
generic map (
ADDR_DECODE_HI_BIT => 5,
ADDR_DECODE_LO_BIT => 4
)
port map (
-- Decoded read/write strobes and returned read data
generic_sequencer_15_wav_write => avs_csr_write_seq_wave,
@ -366,11 +468,14 @@ begin
generic_sequencer_15_print_read => avs_csr_read_seq_print,
generic_sequencer_15_print_readdata => avs_csr_rdata_seq_print,
generic_delay_queue_1_write => avs_csr_write_dly,
generic_delay_queue_1_read => avs_csr_read_dly,
generic_delay_queue_1_readdata => avs_csr_rdata_dly,
generic_delay_queue_1_0_write => delay_queue_write,
generic_delay_queue_1_0_read => delay_queue_read,
generic_delay_queue_1_0_readdata => delay_queue_readdata,
-- Avalon CSR slave interface
local_write => local_write,
local_read => local_read,
local_readdata => local_readdata,
avs_address => avs_csr_address(5 downto 4),
avs_write => avs_csr_write,
avs_read => avs_csr_read,
@ -378,6 +483,35 @@ begin
);
-- -----------------------------------------------
-- Local registers
-- -----------------------------------------------
print_unit_csr_regs_inst : entity work.print_unit_csr_regs
generic map (
ADDR_DECODE_WIDTH => 4
)
port map (
-- Clock and reset
clk => clk,
rst_n => rst_n,
fire_req_count0 => diag_fire_req_count(0),
fire_req_count1 => diag_fire_req_count(1),
fire_start_img_count0 => diag_fire_simg_count(0),
last_stripe_count0 => diag_last_stripe_count(0),
fire_start_img_count1 => diag_fire_simg_count(1),
last_stripe_count1 => diag_last_stripe_count(1),
chan_active => chan_active,
avs_address => avs_csr_address(3 downto 0),
avs_write => local_write,
avs_writedata => avs_csr_writedata,
avs_read => local_read,
avs_readdata => local_readdata
);
-- Auto-generated Avalon SEQ bus decoder block
print_unit_seq_decode_1 : entity work.print_unit_seq_decode
port map(
@ -398,12 +532,14 @@ begin
print_seq_trig <= vector_out(PRINT_LATCH_BIT) & '1';
-- Mask the fire request to the print data sequencer when a current sequence can't accept a new one
fire_req_int <= fire_req and not sequencers_busy;
-- -----------------------------------------------
-- instantiate a print sequencer
-- -----------------------------------------------
seq_print_core_inst : entity work.generic_sequencer_15
generic map(
SEQ_DEPTH => 512,
BUS_WIDTH => SEQ_BUS_WIDTH,
VECTOR_WIDTH => 19,
TRIGGER_WIDTH => 2,
@ -425,14 +561,14 @@ begin
avs_csr_read => avs_csr_read_seq_print,
avs_csr_readdata => avs_csr_rdata_seq_print,
avs_seq_address => avs_seq_address(7 downto 0),
avs_seq_address => avs_seq_address(8 downto 0),
avs_seq_write => avs_seq_write_seq_print,
avs_seq_writedata => avs_seq_writedata,
avs_seq_read => avs_seq_read_seq_print,
avs_seq_readdata => avs_seq_rdata_seq_print_int,
start_req => fire_req_int,
start_addr => fire_data,
start_req => print_seq_start,
start_addr => print_seq_start_addr,
trigger_in => print_seq_trig,
pos_in => (others => '0'),
@ -479,10 +615,10 @@ begin
reset_n => rst_n,
avs_address => avs_csr_address(3 downto 0),
avs_write => avs_csr_write_dly,
avs_write => delay_queue_write,
avs_writedata => avs_csr_writedata,
avs_read => avs_csr_read_dly,
avs_readdata => avs_csr_rdata_dly,
avs_read => delay_queue_read,
avs_readdata => delay_queue_readdata,
-- Incoming signals and packets to be delayed
ingress_valid => wave_req,
@ -548,62 +684,83 @@ begin
avs_seq_rdata_seq_wave <= avs_seq_rdata_seq_wave_int when avs_seq_read_seq_wave_dly = '1' else (others => '0');
-- Allow firing of data core from CPU if requested, else comes from the wave sequencer.
seq_start_req_int <= cpu_data_start or (seq_data_valid and seq_data_config(START_DLY_REQ_BIT) and not seq_data_config(SEQ_BURST_WORD2_BIT));
seq_start_req_first_int <= (cpu_data_start and cpu_data_start_first) or seq_data_config(START_DLY_FIRST_BIT);
seq_start_req_last_int <= (cpu_data_start and cpu_data_start_last) or seq_data_config(START_DLY_LAST_BIT);
seq_start_delay_int <= "00" & cpu_start_dly_head when cpu_data_start = '1' else seq_data_config(START_DLY_BITS);
seq_gl_map_update <= seq_data_valid and seq_data_config(GL_REMAP_UPDATE_BIT) and not seq_data_config(SEQ_BURST_WORD2_BIT);
seq_fp_holdoff_update <= seq_data_valid and seq_data_config(SEQ_BURST_WORD2_BIT);
-- -----------------------------------------------
-- Instantiate the data core
-- -----------------------------------------------
data_core_1 : entity work.data_core
generic map(
MAX_BPP => MAX_BPP,
MAX_OP_WIDTH => MAX_OP_WIDTH,
DELAY_WIDTH => START_DLY_WIDTH
DELAY_WIDTH => START_DLY_WIDTH,
NO_ZERO_GAP => NO_ZERO_GAP,
EN_PEEK => EN_PEEK,
NUM_CHANS => NUM_CHANS
)
port map(
clk => clk,
rst_n => rst_n,
clk => clk,
rst_n => rst_n,
pixel_buf_wr => pixel_buf_wr,
pixel_buf_wr_data => pixel_buf_wr_data,
pixel_buf_rdy => pixel_buf_rdy,
pixel_buf_wr => pixel_buf_wr,
pixel_buf_wr_data => pixel_buf_wr_data,
pixel_buf_rdy => pixel_buf_rdy,
pixel_buf_last_word => pixel_buf_last_word,
chan_en => chan_en,
bpp_mode => bpp_mode,
print_data_width => print_data_width,
clear_buffer => clear_buffer,
pixel_buf_wr_aux => pixel_buf_wr_aux,
pixel_buf_wr_data_aux => pixel_buf_wr_data_aux,
pixel_buf_rdy_aux => pixel_buf_rdy_aux,
pixel_buf_last_word_aux => pixel_buf_last_word_aux,
fire_req => fire_req,
sequencers_busy => sequencers_busy,
fp_holdoff_update => seq_fp_holdoff_update,
wave_seq_len => seq_data_config(15 downto 0),
en_dual_data_path => en_dual_data_path,
chan_en => chan_en,
bpp_mode => bpp_mode,
print_data_width => print_data_width,
clear_buffer => clear_buffer,
cpu_gl_map => cpu_gl_map,
cpu_gl_map_en => cpu_gl_map_en,
fire_req => fire_req,
fire_req_start_merge => fire_req_start_merge_int,
drop_stripe => drop_stripe,
sequencers_busy => sequencers_busy,
px_buf_ch_nactive => px_buf_ch_nactive,
fp_holdoff_update => seq_fp_holdoff_update,
seq_data_config => seq_data_config(15 downto 0),
empty => empty,
full => full,
underrun => underrun,
overrun => overrun,
dbl_drop => dbl_drop,
fp_drop => fp_drop,
cpu_gl_map => cpu_gl_map,
cpu_gl_map_en => cpu_gl_map_en,
seq_start_req => seq_start_req_int,
seq_start_first_pulse => seq_start_req_first_int,
seq_start_last_pulse => seq_start_req_last_int,
seq_start_delay => seq_start_delay_int,
empty => empty,
full => full,
underrun => underrun,
overrun => overrun,
dbl_drop => dbl_drop,
overlap_error => overlap_error,
fp_drop => fp_drop,
seq_gl_map => seq_data_config(GL_REMAP_BITS),
seq_gl_map_update => seq_gl_map_update,
seq_start_req => seq_start_req_int,
seq_start_first_pulse => seq_start_first_pulse_int,
seq_start_last_pulse => seq_start_last_pulse_int,
print_data => print_data_i,
print_clk => print_clk_i,
seq_gl_map => seq_data_config(GL_REMAP_BITS),
seq_gl_map_update => seq_gl_map_update,
diag_word_count => diag_word_count
all_on => '0',
print_data => print_data_i,
print_clk => print_clk_i,
diag_peek_sel => diag_peek_sel,
diag_peek_addr => diag_peek_addr,
diag_peek_data => diag_peek_data,
diag_peek_rdptr => diag_peek_rdptr,
diag_peek_wrptr => diag_peek_wrptr,
diag_peek_wdata => diag_peek_wdata,
diag_peek_wr => diag_peek_wr,
diag_fire_req_count => diag_fire_req_count,
diag_fire_simg_count => diag_fire_simg_count,
diag_last_stripe_count => diag_last_stripe_count,
diag_word_count => diag_word_count
);
@ -639,4 +796,4 @@ begin
end process;
end rtl;
end rtl;

View file

@ -1,9 +1,8 @@
-------------------------------------------------------------------------------
--! @file
--! @brief PWM with specifiable perio (in clk ticks), and control granularity of 1/256
--! @brief Pulse width modulator
--!
--! @details See
--! https://confluence.gisapps.co.uk/pages/viewpage.action?spaceKey=GMAHMB&title=HMB-FD-GMA+Design+Documentation
--! @details PWM with specifiable period (in clk ticks), and control granularity of 1/256
--!
--! @b Clock/resets:
--! @li clk : nominally 100MHz
@ -21,17 +20,14 @@
--! @li VHDL 2008
--!
--! @author Simon Southwell
--! @copyright (c) 2018 Global Inkjet Systems
--! @date 2018-9-20
--! @copyright (c) 2020 Global Inkjet Systems
--! @date 2020-3-20
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use ieee.std_logic_misc.all;
use work.pkg_functions.all;
entity pwm is
port(
@ -69,13 +65,11 @@ begin
elsif clk'event and clk = '1' then
-- If the phase count reaches 1/256th of period, reset to 0 and increment the phase number
if unsigned(mod_val) /= 0 then
if unsigned(phase_count) = (unsigned(period_div256) - 1) then
phase_count <= (others => '0');
phase <= std_logic_vector(unsigned(phase) + 1);
else
phase_count <= std_logic_vector(unsigned(phase_count) + 1);
end if;
if unsigned(phase_count) = (unsigned(period_div256) - 1) then
phase_count <= (others => '0');
phase <= std_logic_vector(unsigned(phase) + 1);
else
phase_count <= std_logic_vector(unsigned(phase_count) + 1);
end if;
-- If the phase number is less than the specified modulation value, set

View file

@ -510,10 +510,10 @@ set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_D7
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_CLK
# I2C
set_location_assignment PIN_C19 -to SDA_SOM
set_location_assignment PIN_A21 -to SDA_APP
set_location_assignment PIN_B16 -to SCL_SOM
set_location_assignment PIN_K18 -to SCL_APP
set_location_assignment PIN_C19 -to SDA_APP
set_location_assignment PIN_A21 -to SDA_SOM
set_location_assignment PIN_B16 -to SCL_APP
set_location_assignment PIN_K18 -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDA_SOM

View file

@ -315,6 +315,7 @@
internal="hps_0.spim0_sclk_out"
type="clock"
dir="start" />
<interface name="i2c" internal="core_0.i2c" type="conduit" dir="end" />
<interface name="hv_clk" internal="core_0.hv_clk" type="conduit" dir="end" />
<interface name="lvds_rx" internal="core_0.lvds_rx" />
<interface name="lvds_tx" internal="core_0.lvds_tx" type="conduit" dir="end" />

View file

@ -26,4 +26,8 @@ set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_spim0|sclk_out}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
# False path from I2C clock to out to back in again
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c0|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}

View file

@ -0,0 +1,51 @@
###################################################################
# Makefile for SoM logic synthesis
#
# Copyright (c) 2020 Global Inkjet Systems
#
###################################################################
SYSTOPNAME = top
HPSNAME = hps_0
OPFILEDIR = output_files
QPFFILE = ${SYSTOPNAME}.qpf
QSYSFILE = ${SYSTOPNAME}_system.qsys
FPGATYPE = "Cyclone V"
FPGAPART = 5CSEBA4U23C7
MAKE_EXE = mingw32-make
all: autobuild hps synth
${SYSTOPNAME}_system.sopcinfo:
@qsys-generate ${QSYSFILE} --synthesis=VHDL --output-directory=${SYSTOPNAME} --family=${FPGATYPE} --part=${FPGAPART}
${HPSNAME}.h: ${SYSTOPNAME}_system.sopcinfo
@bash -c "sopc-create-header-files ${SYSTOPNAME}_system.sopcinfo --single ${HPSNAME}.h --module ${HPSNAME}"
synth: ${SYSTOPNAME}_system.sopcinfo
@quartus_sh --flow compile ${QPFFILE}
@cat ${OPFILEDIR}/${SYSTOPNAME}.sta.rpt | grep "Info" | grep -v "Worst case slack is "
qsys : ${SYSTOPNAME}_system.sopcinfo
hps: ${HPSNAME}.h
.PHONY: autobuild
autobuild:
@${MAKE_EXE} -C ..\src\test autobuild
clean:
@${MAKE_EXE} -C ..\src\test clean
@rm -rf .qsys_edit db hps_isw_handoff incremental_db ${SYSTOPNAME} c5_pin_model_dump.txt *.csv *.qws *.sopcinfo
@rm -rf ${OPFILEDIR}/*.rpt \
${OPFILEDIR}/*.done \
${OPFILEDIR}/*.smsg \
${OPFILEDIR}/*.summary \
${OPFILEDIR}/*.jdi \
${OPFILEDIR}/*.pin \
${OPFILEDIR}/*.rbf \
${OPFILEDIR}/*.sof \
${OPFILEDIR}/*.sld
@rm -rf ${HPSNAME}.h

View file

@ -26,9 +26,9 @@
# Notes:
#
# 1) The default values for assignments are stored in the file:
# top_assignment_defaults.qdf
# top_assignment_defaults.qdf
# If this file doesn't exist, see file:
# assignment_defaults.qdf
# assignment_defaults.qdf
#
# 2) Altera recommends that you do not modify this file. This
# file is updated automatically by the Quartus Prime software
@ -42,7 +42,7 @@ set_global_assignment -name DEVICE 5CSEBA4U23C7
set_global_assignment -name TOP_LEVEL_ENTITY top
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 16.0.0
set_global_assignment -name PROJECT_CREATION_TIME_DATE "12:02:26 MAY 23, 2017"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 Standard Edition"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 SP0.18std Standard Edition"
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
@ -184,6 +184,7 @@ set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[11]
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[12] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[13] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[14] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[15] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[1] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[2] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[3] -tag __hps_sdram_p0
@ -311,6 +312,7 @@ set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[12] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[13] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[14] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[15] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[1] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[2] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[3] -tag __hps_sdram_p0
@ -336,6 +338,7 @@ set_location_assignment PIN_A25 -to memory_mem_ras_n
set_location_assignment PIN_G25 -to memory_mem_ba[2]
set_location_assignment PIN_H25 -to memory_mem_ba[1]
set_location_assignment PIN_A27 -to memory_mem_ba[0]
set_location_assignment PIN_F24 -to memory_mem_a[15]
set_location_assignment PIN_G23 -to memory_mem_a[14]
set_location_assignment PIN_C24 -to memory_mem_a[13]
set_location_assignment PIN_D24 -to memory_mem_a[12]
@ -491,10 +494,10 @@ set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_D7
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_CLK
# I2C
set_location_assignment PIN_C19 -to SDA_SOM
set_location_assignment PIN_A21 -to SDA_APP
set_location_assignment PIN_B16 -to SCL_SOM
set_location_assignment PIN_K18 -to SCL_APP
set_location_assignment PIN_C19 -to SDA_APP
set_location_assignment PIN_A21 -to SDA_SOM
set_location_assignment PIN_B16 -to SCL_APP
set_location_assignment PIN_K18 -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDA_SOM
@ -831,4 +834,4 @@ set_global_assignment -name SDC_FILE ./top_system_timing.sdc
set_global_assignment -name CDF_FILE ./output_files/Chain1.cdf
set_global_assignment -name TIMING_ANALYZER_MULTICORNER_ANALYSIS ON
set_global_assignment -name NUM_PARALLEL_PROCESSORS 5
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View file

@ -7,7 +7,7 @@
description=""
tags=""
categories="System" />
<parameter name="bonusData"><![CDATA[bonusData
<parameter name="bonusData"><![CDATA[bonusData
{
element clk_0
{
@ -315,6 +315,7 @@
internal="hps_0.spim0_sclk_out"
type="clock"
dir="start" />
<interface name="i2c" internal="core_0.i2c" type="conduit" dir="end" />
<interface name="hv_clk" internal="core_0.hv_clk" type="conduit" dir="end" />
<interface name="lvds_rx" internal="core_0.lvds_rx" />
<interface name="lvds_tx" internal="core_0.lvds_tx" type="conduit" dir="end" />
@ -349,8 +350,10 @@
<parameter name="LVDS_TX_CHANS" value="16" />
<parameter name="MAX_HEADS" value="4" />
<parameter name="MAX_OP_WIDTH" value="32" />
<parameter name="NO_ZERO_GAP" value="true" />
<parameter name="NUM_DDR" value="1" />
<parameter name="NUM_HEADS" value="4" />
<parameter name="SEB_EPD_ENABLE" value="true" />
<parameter name="NUM_LVDS_DDR" value="1" />
<parameter name="NUM_LVDS_RX_PIO" value="1" />
<parameter name="NUM_LVDS_TX_PIO" value="30" />
@ -362,6 +365,7 @@
<parameter name="TRIGGER_WIDTH" value="16" />
<parameter name="TX_SERDES_RATIO" value="7" />
<parameter name="VECTOR_WIDTH" value="18" />
<parameter name="STREAMER_LOGGER" value="false" />
</module>
<module
name="generic_versioning_0"
@ -605,7 +609,7 @@
<parameter name="MEM_NUMBER_OF_RANKS_PER_DIMM" value="1" />
<parameter name="MEM_PD" value="DLL off" />
<parameter name="MEM_RANK_MULTIPLICATION_FACTOR" value="1" />
<parameter name="MEM_ROW_ADDR_WIDTH" value="15" />
<parameter name="MEM_ROW_ADDR_WIDTH" value="16" />
<parameter name="MEM_RTT_NOM" value="RZQ/6" />
<parameter name="MEM_RTT_WR" value="Dynamic ODT off" />
<parameter name="MEM_SRT" value="Normal" />

View file

@ -7,7 +7,7 @@ create_clock -name LVDS_TX_SER_CLK -period 10.00 [get_ports TX_P[16]]
derive_pll_clocks
# The fire pulse manager receiver clock is asynchronous to the system clock
# The fire pulse manager receiver clock is asynchronous to the system clock
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}]
create_clock -period 1000.0 -name virtual_ext_clk_1MHz ; # This is a virtual clock, because it's not relative to any internal clock
@ -26,4 +26,19 @@ set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_spim0|sclk_out}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
# False path from I2C clock to out to back in again
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c0|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set quartus_exe $::TimeQuestInfo(nameofexecutable)
if { $quartus_exe == "quartus_fit" } {
post_message -type info "Over constraining hold"
set_clock_uncertainty 0.30 -add -hold -enable_same_physical_edge \
-from [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -to [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}]
}

View file

@ -491,10 +491,10 @@ set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_D7
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_CLK
# I2C
set_location_assignment PIN_C19 -to SDA_SOM
set_location_assignment PIN_A21 -to SDA_APP
set_location_assignment PIN_B16 -to SCL_SOM
set_location_assignment PIN_K18 -to SCL_APP
set_location_assignment PIN_C19 -to SDA_APP
set_location_assignment PIN_A21 -to SDA_SOM
set_location_assignment PIN_B16 -to SCL_APP
set_location_assignment PIN_K18 -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDA_SOM

View file

@ -315,6 +315,7 @@
internal="hps_0.spim0_sclk_out"
type="clock"
dir="start" />
<interface name="i2c" internal="core_0.i2c" type="conduit" dir="end" />
<interface name="hv_clk" internal="core_0.hv_clk" type="conduit" dir="end" />
<interface name="lvds_rx" internal="core_0.lvds_rx" />
<interface name="lvds_tx" internal="core_0.lvds_tx" type="conduit" dir="end" />

View file

@ -29,4 +29,8 @@ set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_spim0|sclk_out}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
# False path from I2C clock to out to back in again
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c0|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}

View file

@ -26,9 +26,9 @@
# Notes:
#
# 1) The default values for assignments are stored in the file:
# top_assignment_defaults.qdf
# top_assignment_defaults.qdf
# If this file doesn't exist, see file:
# assignment_defaults.qdf
# assignment_defaults.qdf
#
# 2) Altera recommends that you do not modify this file. This
# file is updated automatically by the Quartus Prime software
@ -42,7 +42,7 @@ set_global_assignment -name DEVICE 5CSXFC5C6U23C7
set_global_assignment -name TOP_LEVEL_ENTITY top
set_global_assignment -name ORIGINAL_QUARTUS_VERSION 16.0.0
set_global_assignment -name PROJECT_CREATION_TIME_DATE "12:02:26 MAY 23, 2017"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 Standard Edition"
set_global_assignment -name LAST_QUARTUS_VERSION "18.1.0 SP0.18std Standard Edition"
set_global_assignment -name PROJECT_OUTPUT_DIRECTORY output_files
set_global_assignment -name MIN_CORE_JUNCTION_TEMP 0
set_global_assignment -name MAX_CORE_JUNCTION_TEMP 85
@ -184,6 +184,7 @@ set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[11]
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[12] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[13] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[14] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[15] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[1] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[2] -tag __hps_sdram_p0
set_instance_assignment -name IO_STANDARD "SSTL-15 CLASS I" -to memory_mem_a[3] -tag __hps_sdram_p0
@ -311,6 +312,7 @@ set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[12] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[13] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[14] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[15] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[1] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[2] -tag __hps_sdram_p0
set_instance_assignment -name CURRENT_STRENGTH_NEW "MAXIMUM CURRENT" -to memory_mem_a[3] -tag __hps_sdram_p0
@ -337,6 +339,7 @@ set_location_assignment PIN_G25 -to memory_mem_ba[2]
set_location_assignment PIN_H25 -to memory_mem_ba[1]
set_location_assignment PIN_A27 -to memory_mem_ba[0]
set_location_assignment PIN_G23 -to memory_mem_a[14]
set_location_assignment PIN_F24 -to memory_mem_a[15]
set_location_assignment PIN_C24 -to memory_mem_a[13]
set_location_assignment PIN_D24 -to memory_mem_a[12]
set_location_assignment PIN_B24 -to memory_mem_a[11]
@ -491,10 +494,10 @@ set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_D7
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to hps_sdio_CLK
# I2C
set_location_assignment PIN_C19 -to SDA_SOM
set_location_assignment PIN_A21 -to SDA_APP
set_location_assignment PIN_B16 -to SCL_SOM
set_location_assignment PIN_K18 -to SCL_APP
set_location_assignment PIN_C19 -to SDA_APP
set_location_assignment PIN_A21 -to SDA_SOM
set_location_assignment PIN_B16 -to SCL_APP
set_location_assignment PIN_K18 -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SCL_SOM
set_instance_assignment -name IO_STANDARD "3.3-V LVTTL" -to SDA_SOM
@ -814,7 +817,7 @@ set_global_assignment -name REMOVE_DUPLICATE_REGISTERS ON
set_global_assignment -name OPTIMIZATION_MODE BALANCED
set_global_assignment -name OPTIMIZE_HOLD_TIMING "ALL PATHS"
set_global_assignment -name DEVICE_FILTER_SPEED_GRADE 7
set_global_assignment -name SEED 2020
set_global_assignment -name SEED 8
set_global_assignment -name SMART_RECOMPILE OFF
set_global_assignment -name FINAL_PLACEMENT_OPTIMIZATION AUTOMATICALLY
set_global_assignment -name FITTER_AGGRESSIVE_ROUTABILITY_OPTIMIZATION AUTOMATICALLY
@ -831,4 +834,6 @@ set_global_assignment -name SDC_FILE ./top_system_timing.sdc
set_global_assignment -name CDF_FILE ./output_files/Chain1.cdf
set_global_assignment -name TIMING_ANALYZER_MULTICORNER_ANALYSIS ON
set_global_assignment -name NUM_PARALLEL_PROCESSORS 5
set_instance_assignment -name PARTITION_HIERARCHY root_partition -to | -section_id Top

View file

@ -316,6 +316,7 @@
type="clock"
dir="start" />
<interface name="hv_clk" internal="core_0.hv_clk" type="conduit" dir="end" />
<interface name="i2c" internal="core_0.i2c" type="conduit" dir="end" />
<interface name="lvds_rx" internal="core_0.lvds_rx" />
<interface name="lvds_tx" internal="core_0.lvds_tx" type="conduit" dir="end" />
<interface name="memory" internal="hps_0.memory" type="conduit" dir="end" />
@ -349,6 +350,7 @@
<parameter name="LVDS_TX_CHANS" value="16" />
<parameter name="MAX_HEADS" value="4" />
<parameter name="MAX_OP_WIDTH" value="32" />
<parameter name="NO_ZERO_GAP" value="false" />
<parameter name="NUM_DDR" value="1" />
<parameter name="NUM_HEADS" value="4" />
<parameter name="NUM_LVDS_DDR" value="1" />
@ -356,9 +358,10 @@
<parameter name="NUM_LVDS_TX_PIO" value="30" />
<parameter name="NUM_PIO" value="32" />
<parameter name="PCLK_CLK_RATIO" value="8" />
<parameter name="SEB_EPD_ENABLE" value="true" />
<parameter name="SHIFT_DEPTH" value="128" />
<parameter name="SIM_TEST_MODE" value="false" />
<parameter name="SLIM" value="true" />
<parameter name="STREAMER_LOGGER" value="false" />
<parameter name="TRIGGER_WIDTH" value="16" />
<parameter name="TX_SERDES_RATIO" value="7" />
<parameter name="VECTOR_WIDTH" value="18" />
@ -605,7 +608,7 @@
<parameter name="MEM_NUMBER_OF_RANKS_PER_DIMM" value="1" />
<parameter name="MEM_PD" value="DLL off" />
<parameter name="MEM_RANK_MULTIPLICATION_FACTOR" value="1" />
<parameter name="MEM_ROW_ADDR_WIDTH" value="15" />
<parameter name="MEM_ROW_ADDR_WIDTH" value="16" />
<parameter name="MEM_RTT_NOM" value="RZQ/6" />
<parameter name="MEM_RTT_WR" value="Dynamic ODT off" />
<parameter name="MEM_SRT" value="Normal" />
@ -1435,6 +1438,15 @@
<parameter name="baseAddress" value="0x0000" />
<parameter name="defaultConnection" value="false" />
</connection>
<connection
kind="avalon"
version="18.1"
start="core_0.tx"
end="hps_0.f2h_axi_slave">
<parameter name="arbitrationPriority" value="1" />
<parameter name="baseAddress" value="0x0000" />
<parameter name="defaultConnection" value="false" />
</connection>
<connection
kind="clock"
version="18.1"

View file

@ -7,7 +7,7 @@ create_clock -name LVDS_TX_SER_CLK -period 10.00 [get_ports TX_P[16]]
derive_pll_clocks
# The fire pulse manager receiver clock is asynchronous to the system clock
# The fire pulse manager receiver clock is asynchronous to the system clock
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}]
create_clock -period 1000.0 -name virtual_ext_clk_1MHz ; # This is a virtual clock, because it's not relative to any internal clock
@ -26,4 +26,19 @@ set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_0|altera_pll_i|general[1].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|pll_1|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_spim0|sclk_out}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
set_clock_groups -asynchronous -group [get_clocks {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk}] -group [get_clocks {virtual_ext_clk_1MHz}]
# False path from I2C clock to out to back in again
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c0|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set_false_path -from {top_system_1|hps_0|fpga_interfaces|peripheral_i2c1|out_clk} -to {top_system:top_system_1|core:core_0|i2c_stat_d[*]}
set quartus_exe $::TimeQuestInfo(nameofexecutable)
if { $quartus_exe == "quartus_fit" } {
post_message -type info "Over constraining hold"
set_clock_uncertainty 0.30 -add -hold -enable_same_physical_edge \
-from [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}] -to [get_clocks {top_system_1|pll_0|altera_pll_i|general[0].gpll~PLL_OUTPUT_COUNTER|divclk}]
}

View file

@ -1,303 +1,534 @@
[{
"ip_name" : "core",
"bus" : "csr",
"addr_hi_bit" : "15",
"addr_lo_bit" : "10",
"description" : "This block is the top level for the HMB-FD-HV SOM board soft IP for SG1024",
"sub_blocks" : {
"generic_pio_1" : {
"instance" : "",
"process" : "txt,cpp,pkg",
"offset" : "0x0000"
},
"swim_2" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0400"
},
"hmb_fpga_cfg_5" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0c00"
},
"uart_1MBd_3:a" : {
"instance" : "som",
"process" : "enabled",
"offset" : "0x1000"
},
"uart_1MBd_3:b" : {
"instance" : "hmb",
"process" : "enabled",
"offset" : "0x1400"
},
"uart_1MBd_3:c" : {
"instance" : "hmb1",
"process" : "enabled",
"offset" : "0x1800"
},
"print_ctrl" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x1c00"
},
"shutdown_monitor_0" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x2000"
},
"local" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x2400"
},
"fpm_ctrl_4" : {
"instance" : "",
"process" : "cpp, txt",
"offset" : "0x8000"
},
"fpm_diags_4" : {
"instance" : "",
"process" : "cpp, txt",
"offset" : "0x8800"
},
"fpm_event_log_4" : {
"instance" : "",
"process" : "disabled",
"offset" : "0x9000"
},
"enc_pd_emul_1" : {
"instance" : "",
"process" : "cpp, txt",
"offset" : "0x9800"
},
"pulse_generator_2:a" : {
"instance" : "0",
"process" : "cpp, txt",
"offset" : "0xa000"
},
"pulse_generator_2:b" : {
"instance" : "1",
"process" : "cpp, txt",
"offset" : "0xa800"
},
"pulse_generator_2:c" : {
"instance" : "2",
"process" : "cpp, txt",
"offset" : "0xb000"
},
"pulse_generator_2:d" : {
"instance" : "3",
"process" : "cpp, txt",
"offset" : "0xb800"
}
},
"registers" : {
"ip_id" : {
"address" : "0",
"width" : "32",
"description" : "Unique ID for this IP block - https://confluence.gisapps.co.uk/display/EL/EL+Generic+IP+Register",
"fields": {
"ip_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x18",
"description" : "IP identifier number: Project top level core registers for status and control, not assigned elsewhere"
},
"mfr_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x04",
"description" : "Manufacturer number: Fujifilm Dimatix"
"ip_name" : "core",
"bus" : "csr",
"addr_hi_bit" : "15",
"addr_lo_bit" : "11",
"description" : "This block is the top level for the HMB-FD-HV SOM board soft IP for SG1024",
"sub_blocks" : {
"generic_pio_1" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0000"
},
"swim_2" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0800"
},
"uart_1MBd_3:a" : {
"instance" : "som",
"process" : "enabled",
"offset" : "0x1000"
},
"uart_1MBd_3:b" : {
"instance" : "hmb",
"process" : "enabled",
"offset" : "0x1800"
},
"uart_1MBd_3:c" : {
"instance" : "hmb1",
"process" : "enabled",
"offset" : "0x2000"
},
"print_ctrl" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x2800"
},
"shutdown_monitor_0" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x3000"
},
"local" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x3800"
},
"print_ctrl" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x4000"
},
"hmb_fpga_cfg_5" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x4800"
},
"fpm_ctrl_7" : {
"instance" : "",
"process" : "enabled",
"note" : "Fire Pulse Manager (FPM) Control subblock",
"offset" : "0x8000"
},
"epd_diags_7" : {
"instance" : "",
"process" : "enabled",
"note" : "FPM Encoder PD diagnostics subblock. This block is instantiated only when generic ADD_EPD_DIAG is set to true",
"offset" : "0x8800"
},
"event_logger_1" : {
"instance" : "",
"process" : "enabled",
"note" : "FPM subblock. This block is instantiated only when generic ADD_EVENT_LOGGER is set to true",
"offset" : "0x9000"
},
"enc_pd_emul_2" : {
"instance" : "",
"process" : "enabled",
"note" : "FPM subblock. Encoder and PD Emulator",
"offset" : "0x9800"
},
"ems_1" : {
"instance" : "",
"process" : "enabled",
"note" : "FPM subblock. Encoder Management System - used with SEB-EPD to handle encoder/PD inputs",
"offset" : "0xa000"
},
"pof_tx_2" : {
"instance" : "",
"process" : "enabled",
"note" : "FPM subblock. Transmits position/timing info over POF",
"offset" : "0xa800"
},
"pulse_generator_5:a" : {
"instance" : "0",
"process" : "enabled",
"note" : "FPM subblock",
"offset" : "0xb000"
},
"pulse_generator_5:b" : {
"instance" : "1",
"process" : "enabled",
"note" : "FPM subblock",
"offset" : "0xb800"
},
"pulse_generator_5:c" : {
"instance" : "2",
"process" : "enabled",
"note" : "FPM subblock",
"offset" : "0xc000"
},
"pulse_generator_5:d" : {
"instance" : "3",
"process" : "enabled",
"note" : "FPM subblock",
"offset" : "0xc800"
}
},
"registers" : {
"ip_id" : {
"address" : "0",
"width" : "32",
"description" : "Unique ID for this IP block - https://confluence.gisapps.co.uk/display/EL/EL+Generic+IP+Register",
"fields": {
"ip_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x18",
"description" : "IP identifier number: Project top level core registers for status and control, not assigned elsewhere"
},
"mfr_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x04",
"description" : "Manufacturer number: Fujifilm Dimatix"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"ip_ver" : {
"address" : "1",
"width" : "32",
"description" : "Bits[7:0] = Minor version number, Bits[15:8] = Major version number, etc.",
"fields": {
"minor_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x05",
"description" : "Minor number"
},
"major_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x00",
"description" : "Major number"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"ip_ver" : {
"address" : "1",
"width" : "32",
"description" : "Bits[7:0] = Minor version number, Bits[15:8] = Major version number, etc.",
"fields": {
"minor_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x00",
"description" : "Minor number"
},
"major_number" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x01",
"description" : "Major number"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"test_freq_period" : {
"address" : "2",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Period, in system clock ticks (10ns for GMA/HV), of test clock frequency. A value less than 4 disables the clocks and sets them to 0. A value not a multiple of 4 will give imprecision in 90 deg phase offset, tending towards 0 the larger the period."
},
"heater_pwm" : {
"address" : "3",
"width" : "32",
"description" : "PWM seetings for head heaters",
"fields": {
"hd0" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 0 heater PWM setting."
},
"hd1" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 1 heater PWM setting."
},
"hd2" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 2 heater PWM setting."
},
"hd3" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 3 heater PWM setting."
}
}
},
"heater_psu_pwm" : {
"address" : "4",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Fan power supply PWM setting."
},
"fan_pwm" : {
"address" : "5",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Fan PWM setting."
},
"freq_count_clr" : {
"address" : "6",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Clear frequency counter status."
},
"freq_count" : {
"address" : "7",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Frequency counter average pulse width in system clock ticks."
},
"freq_out_of_range" : {
"address" : "8",
"width" : "1",
"type" : "r",
"reset" : "0",
"description" : "Frequency counter input out-of-range."
},
"clr_ovrrng_mask" : {
"address" : "9",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Clear HMB over-range alert stick bit masking HV_EN signals. "
},
"px_word_count" : {
"address" : "10",
"width" : "32",
"description" : "Pixel buffer word count",
"fields": {
"hd0" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 0 px buffer word count."
},
"hd1" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 1 px buffer word count."
},
"hd2" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 2 px buffer word count."
},
"hd3" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 3 px buffer word count."
}
}
},
"en_fire_req_mask" : {
"address" : "11",
"width" : "1",
"type" : "w",
"reset" : "0",
"description" : "Enable fire request masking on shutdown"
},
"swim_port_onehot_enable" : {
"address" : "12",
"width" : "5",
"type" : "w",
"reset" : "1",
"description" : "Chooses which SWIM channel is being driven by the swim instance. (0) for SOM/HOST, (1:4) for head flexes 1 to 4. Only one-hot values are acceptable"
},
"heater_psu_pwm_tick" : {
"address" : "13",
"width" : "32",
"type" : "w",
"reset" : "10000",
"description" : "The PWM setting for the PSU for the heater, in units of system clock per period. I.e. 100MHz clock and 10KHz is 10000"
}
}
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"ip_config" : {
"address" : "2",
"width" : "10",
"description" : "Status register for reading core configuration",
"fields": {
"num_heads" : {
"type" : "r",
"bit_len" : "4",
"reset" : "0",
"description" : "Configured number of heads."
},
"num_heads_2" : {
"type" : "r",
"bit_len" : "4",
"reset" : "0",
"description" : "Configured number of heads in the second print controller (if fitted)."
},
"fast_wave_seq_wr" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Set if has the capability to access the wave sequencers quickly over LVDS"
},
"zero_gap_inline_merge" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Set if capable of zero gap/inline merge"
}
}
},
"fpga_build_ver" : {
"address" : "3",
"width" : "32",
"description" : "Logic build version. Test use only.",
"fields": {
"minor" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x00",
"description" : "Minor Build V1.xx"
},
"major" : {
"type" : "c",
"bit_len" : "8",
"reset" : "0x01",
"description" : "Major Build Vx.00"
},
"reserved" : {
"type" : "rsv",
"bit_len" : "16",
"description" : "Reserved bits"
}
}
},
"fan_pwm" : {
"address" : "4",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Fan PWM setting."
},
"freq_count_clr" : {
"address" : "5",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Clear frequency counter status."
},
"freq_count" : {
"address" : "6",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Frequency counter average pulse width in system clock ticks."
},
"freq_out_of_range" : {
"address" : "7",
"width" : "1",
"type" : "r",
"reset" : "0",
"description" : "Frequency counter input out-of-range."
},
"clr_ovrrng_mask" : {
"address" : "8",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Clear HMB over-range alert stick bit masking HV_EN signals. "
},
"px_word_count" : {
"address" : "10",
"width" : "32",
"description" : "Pixel buffer word count",
"fields": {
"hd0" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 0 px buffer word count."
},
"hd1" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 1 px buffer word count."
},
"hd2" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 2 px buffer word count."
},
"hd3" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 3 px buffer word count."
}
}
},
"diag_ctrl" : {
"address" : "14",
"width" : "4",
"description" : "Diagnostic peek control",
"fields": {
"peek_px0" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Head 0 px buffer peek enable."
},
"peek_px1" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Head 1 px buffer peek enable."
},
"peek_px2" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Head 2 px buffer peek enable."
},
"peek_px3" : {
"type" : "w",
"bit_len" : "1",
"reset" : "0",
"description" : "Head 3 px buffer peek enable."
}
}
},
"diag_peek_addr" : {
"address" : "15",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Peek address"
},
"diag_peek_data" : {
"address" : "16",
"width" : "32",
"type" : "r",
"reset" : "0",
"description" : "Peek data"
},
"diag_peek_ptr" : {
"address" : "17",
"width" : "16",
"description" : "Peek pointers of pixel buffers selected by diag_peek_ctrl and diag_peek_addr",
"fields": {
"rd" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Peek read pointer"
},
"wr" : {
"type" : "r",
"bit_len" : "8",
"reset" : "0",
"description" : "Peek write pointer"
}
}
},
"diag_peek_wr" : {
"address" : "18",
"width" : "1",
"type" : "w0",
"reset" : "0",
"description" : "Peek data write"
},
"diag_peek_wdata" : {
"address" : "19",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Peek write data"
},
"en_fire_req_mask" : {
"address" : "20",
"width" : "1",
"type" : "w",
"reset" : "0",
"description" : "Enable fire request masking on shutdown"
},
"swim_port_onehot_enable" : {
"address" : "21",
"width" : "5",
"type" : "w",
"reset" : "1",
"description" : "Chooses which SWIM channel is being driven by the swim instance. (0) for SOM/HOST, (1:4) for head flexes 1 to 4. Only one-hot values are acceptable"
},
"heater_psu_pwm_tick" : {
"address" : "22",
"width" : "32",
"type" : "w",
"reset" : "10000",
"description" : "The PWM setting for the PSU for the heater, in units of system clock per period. I.e. 100MHz clock and 10KHz is 10000"
},
"i2c_stat" : {
"address" : "26",
"width" : "8",
"description" : "Read the internal and external status of the I2C buses",
"fields": {
"head_sda_ip" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Head I2C SDA input level"
},
"head_scl_ip" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Head I2C SCL input level"
},
"head_sda_op" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Head I2C SDA output from Altera I2C core (does not included Attec Wake up mask)"
},
"head_scl_op" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Head I2C SCL output from Altera I2C core (does not included Attec Wake up mask)"
},
"som_sda_ip" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Som I2C SDA input level"
},
"som_scl_ip" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Som I2C SCL input level"
},
"som_sda_op" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Som I2C SDA output from Altera I2C core (does not included Attec Wake up mask)"
},
"som_scl_op" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Som I2C SCL output from Altera I2C core (does not included Attec Wake up mask)"
}
}
},
"i2c_ctrl" : {
"address" : "27",
"width" : "5",
"description" : "Control the I2C buses",
"fields": {
"reserved" : {
"type" : "rsv",
"bit_len" : "4",
"description" : "Reserved bits"
},
"head_scl_force_9clks" : {
"type" : "w0",
"bit_len" : "1",
"reset" : "0",
"description" : "Head I2C SCL output force 9 clks at 100Khz. Overrides any other controls."
}
}
},
"test_freq_period" : {
"address" : "28",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Period, in system clock ticks (10ns for GMA/HV), of test clock frequency. A value less than 4 disables the clocks and sets them to 0. A value not a multiple of 4 will give imprecision in 90 deg phase offset, tending towards 0 the larger the period."
},
"heater_pwm" : {
"address" : "29",
"width" : "32",
"description" : "PWM seetings for head heaters",
"fields": {
"hd0" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 0 heater PWM setting."
},
"hd1" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 1 heater PWM setting."
},
"hd2" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 2 heater PWM setting."
},
"hd3" : {
"type" : "w",
"bit_len" : "8",
"reset" : "0",
"description" : "Head 3 heater PWM setting."
}
}
},
"heater_psu_pwm" : {
"address" : "30",
"width" : "8",
"type" : "w",
"reset" : "0",
"description" : "Heater PSU PWM setting. PSU PWM is ANDed with individual PWMs to further reduce the on time. Set to FF to disable"
}
}
},
{
"ip_name" : "core",
"bus" : "seq",
"addr_hi_bit" : "13",
"addr_lo_bit" : "13",
"description" : "This block is the top level for the GMA SOM board soft IP",
"process_regs" : "disabled",
"registers" : {
"seq_buff" : {
"address" : "0",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Sequence buffer"
}
},
"sub_blocks" : {
"print_ctrl" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0000"
}
}
"ip_name" : "core",
"bus" : "seq",
"addr_hi_bit" : "13",
"addr_lo_bit" : "13",
"description" : "This block is the top level for the GMA SOM board soft IP",
"process_regs" : "disabled",
"registers" : {
"seq_buff" : {
"address" : "0",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Sequence buffer"
}
},
"sub_blocks" : {
"print_ctrl" : {
"instance" : "",
"process" : "enabled",
"offset" : "0x0000"
}
}
}
]
]

View file

@ -1,5 +1,5 @@
[{
"ip_name": "top",
"description": "This is top level block for HMB-FD_GMA",
"description": "This is top level block for HMB-FD-HV SG1024",
"qsys": "top_system"
}]

View file

@ -1,13 +1,13 @@
-------------------------------------------------------------------------------
--! @file
--! @brief SOM FPGA core logic top level for SG1024
--! @brief SOM FPGA core logic top level for SG1024
--!
--! @details This block is the top level for the core logic of the SOM board
--! FPGA for SG1024 on the HMB-FD-HV product. It instantiates a generic PIO, generic LVDS RX,
--! a SWIM interface for STM8 config, 1MBaud UART for receiving STM8 status,
--! a HMB FPGA config interface and the print controller. See
--! https://confluence.gisapps.co.uk/pages/viewpage.action?spaceKey=GMAHMB&title=HMB-FD-GMA+Design+Documentation
--! which was created for GMA, and has an attached presentation on Presto/SG600
--! which was created for GMA, and has an attached presentation on Presto/SG600
--!
--! @b Clock/resets:
--! @li clk : nominally 100MHz
@ -46,6 +46,7 @@ use ieee.numeric_std.all;
use work.PKG_FUNCTIONS.all;
use work.top_pkg.all;
use work.sg1024_pkg.all;
--! Entity declaration for top level soft IP of SoM for HMB-FD-HV
--! Generics defaults get overridden in qsys so change them there, too
@ -74,9 +75,12 @@ entity core is
PCLK_CLK_RATIO : integer range 1 to 32 := 8; -- Print clock to system clock ratio. At 8, gives 12.5MHz print clock for 100MHz clk
CLK_FREQ_MHZ : integer := 100; -- Ensure in QSYS settings for core that this is set
-- to the same frequency as outclk0 of pll_0
SLIM : boolean := false; -- Use slimmed versions of logic where applicable (e.g. data_streamer)
DYNAMIC_COMBINE : boolean := true; -- Enable the use of dynamic combining to a superhead
SIM_TEST_MODE : boolean := false); -- Put shutdown monitor in test mode (faster timings)
NO_ZERO_GAP : boolean := true; -- Configure for no inline merge zero gap support
SEB_EPD_ENABLE : boolean := true; -- Enable for SEB EPD in fire pulse manager
SIM_TEST_MODE : boolean := false; -- Enable for simulation test mode. Should only be set true in simulation test bench
STREAMER_LOGGER : boolean := false
); -- Put shutdown monitor in test mode (faster timings)
port(
clk : in std_logic;
@ -97,7 +101,7 @@ entity core is
avs_seq_write : in std_logic;
avs_seq_writedata : in std_logic_vector(31 downto 0);
avs_seq_read : in std_logic;
avs_seq_readdata : out std_logic_vector(31 downto 0);
avs_seq_readdata : out std_logic_vector(31 downto 0) := (others => '0');
--AXI write address bus
axm_awaddr : out std_logic_vector(31 downto 0);
@ -116,14 +120,14 @@ entity core is
axm_bready : out std_logic;
--AXI read address bus
axm_araddr : out std_logic_vector(31 downto 0);
axm_arlen : out std_logic_vector(7 downto 0); --burst length - 1 to 256 (ARLEN = burst len -1)
axm_araddr : out std_logic_vector(31 downto 0) := (others => '0');
axm_arlen : out std_logic_vector(7 downto 0) := (others => '0'); --burst length - 1 to 256 (ARLEN = burst len -1)
axm_arsize : out std_logic_vector(2 downto 0); --size, nb bytes, of each transfer in burst
axm_arburst : out std_logic_vector(1 downto 0); --for bursts>1, accept only incr burst=01
axm_arcache : out std_logic_vector(3 downto 0);
axm_aruser : out std_logic;
axm_arprot : out std_logic_vector(2 downto 0);
axm_arvalid : out std_logic; --master addr valid
axm_arvalid : out std_logic := '0'; --master addr valid
axm_arready : in std_logic; --slave ready to accept
-- AXI read data bus
@ -131,6 +135,14 @@ entity core is
axm_rvalid : in std_logic; --slave data valid
axm_rready : out std_logic; --master ready to accept
-- Avalon Master burst write interface for FPGA configuration block
avm_tx_waitrequest: in std_logic;
avm_tx_burstcount : out std_logic_vector(11 downto 0) := (others => '0');
avm_tx_address : out std_logic_vector(31 downto 0) := (others => '0');
avm_tx_write : out std_logic := '0';
avm_tx_writedata : out std_logic_vector(63 downto 0) := (others => '0');
avm_tx_last : out std_logic;
-- SWIM (0) interface on SOM - may cascade to host HMB
-- (1) to (4) are for STM8 devices on Flexes 1 to 4
STM8_SWIM_OUT : out std_logic_vector(4 downto 0); -- Outputs to be tristated in top
@ -171,6 +183,9 @@ entity core is
pio_in : in std_logic_vector(NUM_PIO - 1 downto 0);
ddr_out : out std_logic_vector(NUM_DDR - 1 downto 0);
i2c_stat : in std_logic_vector(31 downto 0);
i2c_ctrl : out std_logic_vector(31 downto 0);
-- LVDS TX
lvds_tx_pio : out std_logic_vector(NUM_LVDS_TX_PIO - 1 downto 0);
lvds_tx_ser : out std_logic_vector(LVDS_TX_CHANS downto 0);
@ -178,10 +193,11 @@ entity core is
-- LVDS RX
TIMING_TX_N : in std_logic;
TIMING_RX_P : in std_logic;
TIMING_TX_P : out std_logic;
TIMING_TX_P_in : in std_logic;
TIMING_TX_P_out : out std_logic;
TIMING_TX_P_oe : out std_logic;
TIMING_RX_N : out std_logic;
-- DEBUG
debug_out : out std_logic_vector(4 downto 0)
);
end entity core;
@ -189,6 +205,7 @@ end entity core;
--! Architecture RTL for top level soft IP of SoM for HMB-FD-HV
architecture rtl of core is
constant NUM_CHANS : integer := 2; -- number of PD inline-merge channels
type print_remap_data_t is array (0 to 3) of std_logic_vector(21 downto 0);
type head_pwm_data_t is array (0 to 3) of std_logic_vector(7 downto 0);
type uart_readdata_t is array (0 to 1) of std_logic_vector(31 downto 0);
@ -215,13 +232,14 @@ architecture rtl of core is
signal pio_csr_write : std_logic;
signal swim_csr_read : std_logic;
signal swim_csr_write : std_logic;
signal fpga_csr_read : std_logic;
signal fpga_csr_write : std_logic;
signal uart_csr_write_som : std_logic;
signal uart_csr_read_som : std_logic;
signal uart_csr_write_hmb : std_logic_vector(1 downto 0);
signal uart_csr_read_hmb : std_logic_vector(1 downto 0);
signal fpga_csr_read : std_logic;
signal fpga_csr_write : std_logic;
signal print_ctrl_write : std_logic;
signal print_ctrl_read : std_logic;
signal print_ctrl_seq_write : std_logic;
@ -281,19 +299,24 @@ architecture rtl of core is
signal lvds_tx_par : std_logic_vector(LVDS_TX_CHANS * TX_SERDES_RATIO - 1 downto 0);
signal fire_req : std_logic_vector(3 downto 0);
signal fire_req_fpm : std_logic_vector(3 downto 0);
signal fire_req : fpm_vec_t(0 to NUM_HEADS - 1);
signal fire_req_start_merge : fpm_vec_t(0 to NUM_HEADS - 1);
signal fire_req_fpm : std_logic_vector(32 * NUM_HEADS - 1 downto 0);
signal fire_req_start_merge_fpm : std_logic_vector(32 * NUM_HEADS - 1 downto 0);
signal fire_req_test : std_logic;
signal timing_in_is_1 : std_logic;
signal timing_rxp_dly : std_logic_vector(7 downto 0);
signal fire_mgr_write : std_logic_vector(7 downto 0);
signal fire_mgr_read : std_logic_vector(7 downto 0);
signal fire_mgr_waitrequest : std_logic;
signal fire_mgr_readdata : std_logic_vector(31 downto 0);
signal fire_mgr_readdata_int : std_logic_vector(31 downto 0);
signal fire_pulse_mgr_read : std_logic;
signal fire_pulse_mgr_write : std_logic;
signal fire_pulse_mgr_active : std_logic;
signal fpm_write : std_logic;
signal fpm_read : std_logic;
signal fpm_write_bus : std_logic_vector(9 downto 0);
signal fpm_read_bus : std_logic_vector(9 downto 0);
signal fpm_readdata : std_logic_vector(31 downto 0);
signal px_buf_ch_nactive : std_logic_vector(NUM_CHANS * MAX_HEADS - 1 downto 0) := (others => '1'); -- DCS default to inactive
signal stream_busy_a : std_logic_vector(MAX_HEADS - 1 downto 0);
signal stream_busy_b : std_logic_vector(MAX_HEADS - 1 downto 0);
signal pwr_seq_irq_int : std_logic;
@ -302,13 +325,15 @@ architecture rtl of core is
signal en_test_fp_logic : std_logic;
signal en_test_pwr_ctrl : std_logic;
signal ps_wr : std_logic;
signal ps_wr_data : std_logic_vector(31 downto 0);
signal ps_rdy : std_logic;
signal fpm_rx : std_logic;
signal fpm_pof_tx : std_logic;
signal fpm_pof_rx : std_logic;
signal fpm_select_pof_niso : std_logic;
signal seb_epd_mode_en : std_logic;
signal seb_epd_enc_p1 : std_logic;
signal seb_epd_enc_p2 : std_logic;
signal seb_epd_pd : std_logic;
-- Avalon Master interface for FPGA configuration block
signal avm_rx_waitrequest : std_logic;
signal avm_rx_readdata : std_logic_vector(31 downto 0);
@ -343,25 +368,185 @@ architecture rtl of core is
signal avs_csr_read_cl : std_logic;
signal avs_csr_readdata_cl : std_logic_vector(31 downto 0);
signal diag_peek_sel : std_logic_vector(3 downto 0);
signal diag_peek_addr : std_logic_vector(31 downto 0);
signal diag_peek_data : std_logic_vector(31 downto 0);
signal diag_peek_rdptr : std_logic_vector(7 downto 0);
signal diag_peek_wrptr : std_logic_vector(7 downto 0);
signal diag_peek_wdata : std_logic_vector(31 downto 0);
signal diag_peek_wr : std_logic;
signal swim_port_onehot_enable : std_logic_vector(4 downto 0) := b"00001";
signal stm8_swim_out_int : std_logic;
signal stm8_swim_in_int : std_logic;
signal wd_alarm : std_logic;
signal is_zero_gap : std_logic;
signal i2c_stat_d : std_logic_vector(31 downto 0);
signal head_sda_ip : std_logic;
signal head_scl_ip : std_logic;
signal head_sda_op : std_logic;
signal head_scl_op : std_logic;
signal som_sda_ip : std_logic;
signal som_scl_ip : std_logic;
signal som_sda_op : std_logic;
signal som_scl_op : std_logic;
signal head_scl_force_9clks : std_logic;
signal head_scl_force_9clks_reg : std_logic;
signal do_force_i2c_clk : std_logic;
signal do_force_i2c_clk_high : std_logic;
signal force_bits_todo : integer range 0 to 20;
signal force_clk_count : integer range 0 to 500;
signal pof_rx_debug : std_logic_vector(31 downto 0);
begin
-- -----------------------------------
-- -----------------------------------
-- FPM combinatorial logic
-- -----------------------------------
pFPM_VEC : process(all)
begin
for i in 0 to NUM_HEADS - 1 loop
-- Squelch fire requests when disabled.
if disable_fire_reqs then
fire_req(i) <= (others => '0');
else
fire_req(i) <= fire_req_fpm(32 * i + 31 downto 32 * i);
end if;
fire_req_start_merge(i) <= fire_req_start_merge_fpm(32 * i + 31 downto 32 * i);
end loop;
end process;
fpm_write <= '1' when unsigned(fpm_write_bus) /= 0 else '0';
fpm_read <= '1' when unsigned(fpm_read_bus) /= 0 else '0';
gFPM_IO : if SEB_EPD_ENABLE = false generate
-- POF module only
-- One pin is associated to the electrical input, the other to the optical input
fpm_pof_rx <= TIMING_TX_N when fpm_select_pof_niso = '1' else TIMING_RX_P;
-- One pin is associated to the electrical output, the other to the optical output
TIMING_TX_P_out <= fpm_pof_tx;
TIMING_RX_N <= fpm_pof_tx;
seb_epd_pd <= '0';
seb_epd_enc_p1 <= '0';
seb_epd_enc_p2 <= '0';
else generate
-- either POF module or SEB-EPD
-- One pin is associated to the electrical input, the other to the optical input
fpm_pof_rx <= '1' when seb_epd_mode_en = '1' else TIMING_TX_N when fpm_select_pof_niso = '1' else TIMING_RX_P;
-- One pin is associated to the electrical output, the other to the optical output
TIMING_TX_P_out <= fpm_pof_tx;
TIMING_RX_N <= fpm_pof_tx;
seb_epd_pd <= '0' when seb_epd_mode_en = '0' else TIMING_RX_P;
seb_epd_enc_p1 <= '0' when seb_epd_mode_en = '0' else TIMING_TX_P_in;
seb_epd_enc_p2 <= '0' when seb_epd_mode_en = '0' else TIMING_TX_N;
TIMING_TX_P_oe <= not seb_epd_mode_en;
end generate gFPM_IO;
-- -----------------------------------
-- Synchronous processes
-- -----------------------------------
-- Asynchronous re-register onto clk
process(clk, reset_n) is
begin
if reset_n = '0' then
i2c_stat_d <= (others => '0');
head_sda_ip <= '0';
head_scl_ip <= '0';
head_sda_op <= '0';
head_scl_op <= '0';
som_sda_ip <= '0';
som_scl_ip <= '0';
som_sda_op <= '0';
som_scl_op <= '0';
elsif clk'event and clk = '1' then
i2c_stat_d <= i2c_stat;
head_sda_ip <= i2c_stat_d(I2C_STAT_HEAD_SDA_IP);
head_scl_ip <= i2c_stat_d(I2C_STAT_HEAD_SCL_IP);
head_sda_op <= i2c_stat_d(I2C_STAT_HEAD_SDA_OP);
head_scl_op <= i2c_stat_d(I2C_STAT_HEAD_SCL_OP);
som_sda_ip <= i2c_stat_d(I2C_STAT_SOM_SDA_IP);
som_scl_ip <= i2c_stat_d(I2C_STAT_SOM_SCL_IP);
som_sda_op <= i2c_stat_d(I2C_STAT_SOM_SDA_OP);
som_scl_op <= i2c_stat_d(I2C_STAT_SOM_SCL_OP);
end if;
end process;
P_I2C_PROC : process(clk, reset_n)
begin
if reset_n = '0' then
i2c_ctrl <= (others => '0');
head_scl_force_9clks_reg <= '0';
do_force_i2c_clk <= '0';
do_force_i2c_clk_high <= '1';
elsif rising_edge(clk) then
head_scl_force_9clks_reg <= head_scl_force_9clks;
if head_scl_force_9clks = '1' and head_scl_force_9clks_reg = '0' then
force_bits_todo <= 18; -- 9 high 9 low
force_clk_count <= 499;
do_force_i2c_clk <= '1';
do_force_i2c_clk_high <= '1';
end if;
if force_bits_todo > 0 then
if force_clk_count > 0 then
force_clk_count <= force_clk_count - 1;
else
force_clk_count <= 499;
force_bits_todo <= force_bits_todo - 1;
do_force_i2c_clk_high <= not do_force_i2c_clk_high; -- toggle clock
end if;
elsif do_force_i2c_clk = '1' then -- reset everything
force_bits_todo <= 0;
force_clk_count <= 0;
do_force_i2c_clk <= '0';
do_force_i2c_clk_high <= '1';
end if;
i2c_ctrl(I2C_CTRL_HEAD_SCL_FORCE_EN) <= do_force_i2c_clk;
i2c_ctrl(I2C_CTRL_HEAD_SCL_FORCE_LVL) <= do_force_i2c_clk_high;
end if;
end process;
-- -----------------------------------
-- Constant latancy CSR interface fix
-- for FPM
-- -----------------------------------
constant_latency_if_inst : entity work.constant_latency_if
generic map(
READ_WAIT => 4,
WRITE_WAIT => 1
WRITE_WAIT => 1,
ADDR_WIDTH => 16
)
port map(
reset_n => reset_n,
clk => clk,
avs_var_lat_req => fire_pulse_mgr_active,
avs_var_lat_req => '0',
avs_var_lat_err => open,
-- Avalon MM (Slave) Interface
avs_sl_address => avs_csr_address,
avs_sl_write => avs_csr_write,
@ -375,7 +560,7 @@ begin
avs_ms_writedata => avs_csr_writedata_cl,
avs_ms_read => avs_csr_read_cl,
avs_ms_readdata => avs_csr_readdata_cl,
avs_ms_waitrequest => fire_mgr_waitrequest
avs_ms_waitrequest => '0'
);
process(clk, reset_n) is
@ -389,6 +574,10 @@ begin
end process;
core_csr_decode_1 : entity work.core_csr_decode
generic map(
ADDR_DECODE_HI_BIT => 15,
ADDR_DECODE_LO_BIT => 11
)
port map(
local_write => local_csr_write,
@ -419,39 +608,54 @@ begin
shutdown_monitor_0_read => shutdown_monitor_read,
shutdown_monitor_0_readdata => shutdown_monitor_readdata,
fpm_ctrl_4_write => fire_mgr_write(0),
fpm_ctrl_4_read => fire_mgr_read(0),
fpm_ctrl_4_readdata => fire_mgr_readdata,
fpm_diags_4_write => fire_mgr_write(1),
fpm_diags_4_read => fire_mgr_read(1),
fpm_diags_4_readdata => (others => '0'),
fpm_event_log_4_write => fire_mgr_write(2),
fpm_event_log_4_read => fire_mgr_read(2),
fpm_event_log_4_readdata => (others => '0'),
enc_pd_emul_1_write => fire_mgr_write(3),
enc_pd_emul_1_read => fire_mgr_read(3),
enc_pd_emul_1_readdata => (others => '0'),
pulse_generator_2_0_write => fire_mgr_write(4),
pulse_generator_2_0_read => fire_mgr_read(4),
pulse_generator_2_0_readdata => (others => '0'),
pulse_generator_2_1_write => fire_mgr_write(5),
pulse_generator_2_1_read => fire_mgr_read(5),
pulse_generator_2_1_readdata => (others => '0'),
pulse_generator_2_2_write => fire_mgr_write(6),
pulse_generator_2_2_read => fire_mgr_read(6),
pulse_generator_2_2_readdata => (others => '0'),
pulse_generator_2_3_write => fire_mgr_write(7),
pulse_generator_2_3_read => fire_mgr_read(7),
pulse_generator_2_3_readdata => (others => '0'),
fpm_ctrl_7_write => fpm_write_bus(0),
fpm_ctrl_7_read => fpm_read_bus(0),
fpm_ctrl_7_readdata => fpm_readdata,
epd_diags_7_write => fpm_write_bus(1),
epd_diags_7_read => fpm_read_bus(1),
epd_diags_7_readdata => (others => '0'),
event_logger_1_write => fpm_write_bus(2),
event_logger_1_read => fpm_read_bus(2),
event_logger_1_readdata => (others => '0'),
enc_pd_emul_2_write => fpm_write_bus(3),
enc_pd_emul_2_read => fpm_read_bus(3),
enc_pd_emul_2_readdata => (others => '0'),
ems_1_write => fpm_write_bus(4),
ems_1_read => fpm_read_bus(4),
ems_1_readdata => (others => '0'),
pof_tx_2_write => fpm_write_bus(5),
pof_tx_2_read => fpm_read_bus(5),
pof_tx_2_readdata => (others => '0'),
pulse_generator_5_0_write => fpm_write_bus(6),
pulse_generator_5_0_read => fpm_read_bus(6),
pulse_generator_5_0_readdata => (others => '0'),
pulse_generator_5_1_write => fpm_write_bus(7),
pulse_generator_5_1_read => fpm_read_bus(7),
pulse_generator_5_1_readdata => (others => '0'),
pulse_generator_5_2_write => fpm_write_bus(8),
pulse_generator_5_2_read => fpm_read_bus(8),
pulse_generator_5_2_readdata => (others => '0'),
pulse_generator_5_3_write => fpm_write_bus(9),
pulse_generator_5_3_read => fpm_read_bus(9),
pulse_generator_5_3_readdata => (others => '0'),
avs_address => avs_csr_address_cl(15 downto 10),
avs_write => avs_csr_write_cl,
avs_read => avs_csr_read_cl,
avs_readdata => avs_csr_readdata_cl
avs_address => avs_csr_address_cl(15 downto 11),
avs_write => avs_csr_write_cl,
avs_read => avs_csr_read_cl,
avs_readdata => avs_csr_readdata_cl
);
-- -----------------------------------
-- Auto-generated Address decode block
-- for SEQ bus
-- -----------------------------------
core_seq_decode_1 : entity work.core_seq_decode
generic map(
ADDR_DECODE_HI_BIT => 13,
ADDR_DECODE_LO_BIT => 13
)
port map(
-- Decoded read/write strobes and returned read data
@ -466,9 +670,14 @@ begin
);
-- -----------------------------------
-- Auto-generated core level CSR
-- registers
-- -----------------------------------
core_csr_regs_1 : entity work.core_csr_regs
generic map(
ADDR_DECODE_WIDTH => 6
ADDR_DECODE_WIDTH => 5
)
port map(
clk => clk,
@ -492,15 +701,47 @@ begin
px_word_count_hd1 => diag_word_count_comb(15 downto 8),
px_word_count_hd2 => diag_word_count_comb(23 downto 16),
px_word_count_hd3 => diag_word_count_comb(31 downto 24),
diag_ctrl_peek_px0 => diag_peek_sel(0),
diag_ctrl_peek_px1 => diag_peek_sel(1),
diag_ctrl_peek_px2 => diag_peek_sel(2),
diag_ctrl_peek_px3 => diag_peek_sel(3),
diag_peek_addr => diag_peek_addr,
diag_peek_data => diag_peek_data,
diag_peek_ptr_rd => diag_peek_rdptr,
diag_peek_ptr_wr => diag_peek_wrptr,
diag_peek_wr => diag_peek_wr,
diag_peek_wdata => diag_peek_wdata,
ip_config_num_heads => std_logic_vector(to_unsigned(NUM_HEADS, 4)),
ip_config_num_heads_2 => std_logic_vector(to_unsigned(0, 4)),
ip_config_fast_wave_seq_wr => '1',
ip_config_zero_gap_inline_merge => is_zero_gap,
i2c_ctrl_head_scl_force_9clks => head_scl_force_9clks,
i2c_stat_head_sda_ip => head_sda_ip,
i2c_stat_head_scl_ip => head_scl_ip,
i2c_stat_head_sda_op => head_sda_op,
i2c_stat_head_scl_op => head_scl_op,
i2c_stat_som_sda_ip => som_sda_ip,
i2c_stat_som_scl_ip => som_scl_ip,
i2c_stat_som_sda_op => som_sda_op,
i2c_stat_som_scl_op => som_scl_op,
-- Slave bus port
avs_address => avs_csr_address_cl(5 downto 0),
avs_write => local_csr_write,
avs_writedata => avs_csr_writedata_cl,
avs_read => local_csr_read,
avs_readdata => local_csr_readdata
avs_address => avs_csr_address_cl(4 downto 0),
avs_write => local_csr_write,
avs_writedata => avs_csr_writedata_cl,
avs_read => local_csr_read,
avs_readdata => local_csr_readdata
);
is_zero_gap <= '0' when NO_ZERO_GAP else '1';
-- -----------------------------------
-- Fan PWM
-- -----------------------------------
pwm_fan_inst : entity work.pwm
port map(
clk => clk,
@ -524,7 +765,7 @@ begin
pwm_out => pwm_out_heat_int(i)
);
pwm_out_heat(i) <= pwm_out_heat_int(i) and pwm_psu_out_heater;
pwm_out_heat(i) <= pwm_out_heat_int(i) and pwm_psu_out_heater and not pwr_seq_irq_int; -- pwr_seq_irq_int is actually shutdown but much earlier than the actual power goes off. Make sure heaters are off when triggered
end generate;
-- Heater PSU PWM
@ -556,6 +797,11 @@ begin
);
-- -----------------------------------
-- Generic PIO for general CPU control
-- and LVDS TX
-- -----------------------------------
generic_pio_inst : entity work.generic_pio_1
generic map(
ENA_DDR => ENA_DDR,
@ -617,22 +863,22 @@ begin
-- https://confluence.gisapps.co.uk/pages/viewpage.action?pageId=33423866
GEN_LVDS_PAR : for i in 0 to 3 generate
print_data_int(i) <= pio_out_int(PIO_OUT_HD0_PWR_EN + i) & -- 21 Head I2C enable Should be tied to "HEAD_EN" or equivalent. (takes base address and adds offsets)
print_data_int(i) <= pio_out_int(PIO_OUT_HD0_PWR_EN + i) & -- 21 Head I2C enable Should be tied to "HEAD_EN" or equivalent. (takes base address and adds offsets)
'0' & -- 20 DON'T CARE
'0' & -- 19 DON'T CARE
'0' & -- 18 DON'T CARE (pclk on slave FPGA).
flx_therm_trip_rst(i) & -- 17 FLX_THERM_TRIP_RST
flx_stm8_trigger_rx0(i) & -- 16 FLX_STM8_TRIGGER_RX0
'0' & -- 15 DON'T CARE
'0' & -- 14 DON'T CARE
flx_therm_trip_rst(i) & -- 17 FLX_THERM_TRIP_RST
flx_stm8_trigger_rx0(i) & -- 16 FLX_STM8_TRIGGER_RX0
'0' & -- 15 DON'T CARE
'0' & -- 14 DON'T CARE
'0' & -- 13 DON'T CARE
print_latch(i) & -- 12 C1_LATCH - TODO create separate latches for W2 cable
print_latch(i) & -- 11 C2_LATCH
not (pio_out_int(PIO_OUT_HD0_PWR_EN + i)) & -- 10 nEnable LVDS Active low signal, enables LVDS drivers to head. Should be tied to "~HEAD_EN" or equivalent.
print_clk(i) & -- 9 C1_CLK - TODO create separate clocks for W2 cable
print_clk(i) & -- 8 C2_CLK
print_clk(i) & -- 8 C2_CLK
-- Only 8-bit wide head data, but leave the serialiser untouched for now.
print_data(7 + i * 8 downto i * 8); -- 7:0 Data
print_data(7 + i * 8 downto i * 8); -- 7:0 Data
-- Export the block signals to the LVDS transmitters
lvds_tx_par(i * 22 + 21 downto i * 22) <= print_data_int(i);
@ -700,7 +946,7 @@ begin
lvds_tx_pio(LVDS_TX_HV_EN0) <= lvds_tx_pio_int(LVDS_TX_HV_EN0) and not alert_trig_hmb_ovr_sticky(0) and pwr_seq_control_en(SIG_SEQ_CTRL_HV_0);
lvds_tx_pio(LVDS_TX_HV_EN1) <= lvds_tx_pio_int(LVDS_TX_HV_EN1) and not alert_trig_hmb_ovr_sticky(1) and pwr_seq_control_en(SIG_SEQ_CTRL_HV_1);
-- -----------------------------------
-- *** TEST CODE ONLY ***
@ -890,16 +1136,16 @@ begin
avs_csr_read => fpga_csr_read,
avs_csr_readdata => fpga_csr_readdata,
avm_rx_waitrequest => avm_rx_waitrequest,
avm_rx_burstcount => avm_rx_burstcount_fpga,
avm_rx_address => avm_rx_address_fpga,
avm_rx_read => avm_rx_read_fpga,
avm_rx_readdata => avm_rx_readdata,
avm_rx_readdatavalid => avm_rx_readdatavalid,
avm_rx_waitrequest => '0',
avm_rx_burstcount => open,
avm_rx_address => open,
avm_rx_read => open,
avm_rx_readdata => (others => '0'),
avm_rx_readdatavalid => '0',
ps_wr => ps_wr,
ps_wr_data => ps_wr_data,
ps_rdy => ps_rdy,
ps_wr => '0',
ps_wr_data => (others => '0'),
ps_rdy => open,
cfg_dclk => cfg_dclk,
cfg_data => cfg_data,
@ -921,14 +1167,17 @@ begin
SHIFT_DEPTH => SHIFT_DEPTH,
PCLK_CLK_RATIO => PCLK_CLK_RATIO,
DYNAMIC_COMBINE => DYNAMIC_COMBINE,
SLIM => SLIM
NUM_CHANS => NUM_CHANS,
NO_ZERO_GAP => NO_ZERO_GAP,
EN_PEEK => true,
STREAMER_LOGGER => STREAMER_LOGGER
)
port map(
clk => clk,
clk_x2 => clk_x2,
rst_n => reset_n,
avs_csr_address => avs_csr_address_cl(9 downto 0),
avs_csr_address => avs_csr_address_cl(10 downto 0),
avs_csr_write => print_ctrl_write,
avs_csr_writedata => avs_csr_writedata_cl,
avs_csr_read => print_ctrl_read,
@ -940,13 +1189,6 @@ begin
avs_seq_read => print_ctrl_seq_read,
avs_seq_readdata => print_ctrl_seq_readdata,
avm_rx_waitrequest => avm_rx_waitrequest,
avm_rx_burstcount => avm_rx_burstcount_fpga,
avm_rx_address => avm_rx_address_fpga,
avm_rx_read => avm_rx_read_fpga,
avm_rx_readdata => avm_rx_readdata,
avm_rx_readdatavalid => avm_rx_readdatavalid,
axm_awaddr => axm_awaddr,
axm_awprot => axm_awprot,
axm_awvalid => axm_awvalid,
@ -974,9 +1216,19 @@ begin
axm_rvalid => axm_rvalid,
axm_rready => axm_rready,
fire_req => fire_req(NUM_HEADS - 1 downto 0),
-- Avalon Master burst write interface for FPGA configuration block
avm_tx_waitrequest => avm_tx_waitrequest,
avm_tx_burstcount => avm_tx_burstcount,
avm_tx_address => avm_tx_address,
avm_tx_write => avm_tx_write,
avm_tx_writedata => avm_tx_writedata,
avm_tx_last => avm_tx_last,
fire_req => fire_req,
fire_req_start_merge => fire_req_start_merge,
fire_data => (others => '0'),
px_buf_ch_nactive => px_buf_ch_nactive(NUM_CHANS * NUM_HEADS - 1 downto 0),
stm8_trigger_rx => stm8_trigger_rx,
sig_seq_force_dacs_0v => sig_seq_force_dacs_0v,
@ -990,13 +1242,18 @@ begin
head_data_map_rev => head_data_map_rev,
gma99 => gma99,
pof_rx_debug => pof_rx_debug,
fpm_select_pof_niso => fpm_select_pof_niso,
en_test_fp_logic => en_test_fp_logic,
en_test_pwr_ctrl => en_test_pwr_ctrl,
ps_wr => ps_wr,
ps_wr_data => ps_wr_data,
ps_rdy => ps_rdy,
diag_peek_sel => diag_peek_sel,
diag_peek_addr => diag_peek_addr,
diag_peek_data => diag_peek_data,
diag_peek_rdptr => diag_peek_rdptr,
diag_peek_wrptr => diag_peek_wrptr,
diag_peek_wdata => diag_peek_wdata,
diag_peek_wr => diag_peek_wr,
diag_word_count_comb => diag_word_count_comb,
@ -1043,72 +1300,61 @@ begin
);
fire_pulse_manager_inst : entity work.fire_pulse_manager_4
-- -----------------------------------
-- Fire pulse manager
-- -----------------------------------
fire_pulse_manager_inst : entity work.fire_pulse_manager_7
generic map(
SEB_EPD_MODE => SEB_EPD_ENABLE,
CH_NUM => NUM_HEADS,
PD_QUEUE_SIZE => 512,
ADD_EPD_DIAGS => false,
ADD_EVENT_LOGGER => false,
LOG_FIFO_SIZE => 1024,
PULSE_DELAY_EQUAL_EN => false,
TOF_COMP_EN => false,
PIXEL_PITCH_CORR_EN => false)
port map(
reset_n => reset_n,
clk => clk,
rx_clk => clk_fpm_rx,
pof_rx => fpm_rx,
pof_tx => TIMING_TX_P,
pof_iso_en => open,
reset_n => reset_n,
pof_rx => fpm_pof_rx,
pof_tx => fpm_pof_tx,
seb_epd_mode_en => seb_epd_mode_en,
seb_epd_enc_p1 => seb_epd_enc_p1,
seb_epd_enc_p2 => seb_epd_enc_p2,
seb_epd_pd => seb_epd_pd,
stream_busy_a => stream_busy_a(NUM_HEADS - 1 downto 0),
stream_busy_b => stream_busy_b(NUM_HEADS - 1 downto 0),
fire_pulse => fire_req_fpm,
start_of_image => open,
start_of_image => fire_req_start_merge_fpm,
dp_dir_out => open,
abs_pos_out => open,
print_start => open,
pof_iso_en => open,
mon_pt => open,
ins_fpm_irq_0 => open,
ins_fpm_irq_1 => open,
ins_fpm_irq_2 => open,
ins_fpm_irq_3 => open,
pof_rx_debug => pof_rx_debug,
avs_address => avs_csr_address_cl(14 downto 0),
avs_write => fire_pulse_mgr_write,
avs_write => fpm_write,
avs_writedata => avs_csr_writedata_cl,
avs_read => fire_pulse_mgr_read,
avs_waitrequest => fire_mgr_waitrequest,
avs_readdata => fire_mgr_readdata_int
avs_read => fpm_read,
avs_readdata => fpm_readdata
);
fire_pulse_mgr_write <= '1' when fire_mgr_write /= 8x"0" else '0';
fire_pulse_mgr_read <= '1' when fire_mgr_read /= 8x"0" else '0';
fire_pulse_mgr_active <= fire_pulse_mgr_write or fire_pulse_mgr_read;
-- PD inline merge channel busy flags
stream_busy_a <= not (px_buf_ch_nactive(6) & px_buf_ch_nactive(4) & px_buf_ch_nactive(2) & px_buf_ch_nactive(0));
stream_busy_b <= not (px_buf_ch_nactive(7) & px_buf_ch_nactive(5) & px_buf_ch_nactive(3) & px_buf_ch_nactive(1));
-- The fire pulse manager does not give 0 when inactive read, so fix this here.
fire_mgr_readdata <= fire_mgr_readdata_int when fire_mgr_waitrequest = '0' else (others => '0');
fpm_rx <= TIMING_TX_N when fpm_select_pof_niso = '1' else TIMING_RX_P;
TIMING_RX_N <= TIMING_TX_P;
GEN_TEST_FIRE_REQ : if ENA_TEST_FP_GEN generate
TEST_FP_PROC : process(clk, reset_n) is
begin
if reset_n = '0' then
fire_req_test <= '0';
timing_in_is_1 <= '0';
timing_rxp_dly <= (others => '0');
elsif clk'event and clk = '1' then
fire_req_test <= '0';
timing_rxp_dly <= timing_rxp_dly(6 downto 0) & TIMING_RX_P;
if timing_in_is_1 = '0' and timing_rxp_dly(7 downto 2) = "111111" then
fire_req_test <= '1';
timing_in_is_1 <= '1';
end if;
if timing_in_is_1 = '1' and timing_rxp_dly(7 downto 2) = "000000" then
timing_in_is_1 <= '0';
end if;
end if;
end process;
fire_req <= "1111" when (en_test_fp_logic and fire_req_test) else
fire_req_fpm when (not en_test_fp_logic and not disable_fire_reqs) else
"0000";
end generate;
GEN_NO_TEST_FIRE_REQ : if not ENA_TEST_FP_GEN generate
fire_req <= fire_req_fpm when not disable_fire_reqs else "0000";
end generate;
end rtl;

View file

@ -3,21 +3,21 @@
# DO NOT MODIFY
#
#
# core "core" v1.0
# 2019.10.18.11:11:20
#
#
#
#
#
#
# request TCL package from ACDS 16.1
#
#
package require -exact qsys 16.1
#
#
# module core
#
#
set_module_property DESCRIPTION ""
set_module_property NAME core
set_module_property VERSION 1.0
@ -32,9 +32,9 @@ set_module_property ALLOW_GREYBOX_GENERATION false
set_module_property REPORT_HIERARCHY false
#
#
# file sets
#
#
add_fileset QUARTUS_SYNTH QUARTUS_SYNTH "" ""
set_fileset_property QUARTUS_SYNTH TOP_LEVEL core
set_fileset_property QUARTUS_SYNTH ENABLE_RELATIVE_INCLUDE_PATHS false
@ -44,6 +44,7 @@ add_fileset_file altera_up_sync_fifo_3.v VERILOG PATH ../../generic_ip/uart_1MBd
add_fileset_file altera_up_rs232_in_deserializer_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_in_deserializer_3.v
add_fileset_file altera_up_rs232_out_serializer_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_out_serializer_3.v
add_fileset_file uart_1MBd_rs232_3.v VERILOG PATH ../../generic_ip/uart_1MBd/3/src/altera/uart_1MBd_rs232_3.v
add_fileset_file sg1024_pkg.vhd VHDL PATH sg1024_pkg.vhd
add_fileset_file uart_1MBd_3_pkg_auto.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3_pkg_auto.vhd
add_fileset_file uart_1MBd_3_csr_regs_auto.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3_csr_regs_auto.vhd
add_fileset_file uart_1MBd_3.vhd VHDL PATH ../../generic_ip/uart_1MBd/3/src/uart_1MBd_3.vhd
@ -51,8 +52,20 @@ add_fileset_file common_pkg.vhd VHDL PATH ../../generic_ip/common/0/src/common_p
add_fileset_file pkg_functions.vhd VHDL PATH ../../generic_ip/common/0/src/pkg_functions.vhd
add_fileset_file markov_edges.vhd VHDL PATH ../../generic_ip/common/0/src/markov_edges.vhd
add_fileset_file sync_reset.vhd VHDL PATH ../../generic_ip/common/0/src/sync_reset.vhd
add_fileset_file sync_pulse.vhd VHDL PATH ../../generic_ip/common/0/src/sync_pulse.vhd
add_fileset_file alt_dp_ram.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_dp_ram.vhd
add_fileset_file alt_rw_dp_ram.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_rw_dp_ram.vhd
add_fileset_file vendor_pkg_1.vhd VHDL PATH ../../generic_ip/common/1/src/vendor_pkg_1.vhd
add_fileset_file alt_sync_fifo_1.vhd VHDL PATH ../../generic_ip/common/1/src/altera/alt_sync_fifo_1.vhd
add_fileset_file sync_fifo_1.vhd VHDL PATH ../../generic_ip/common/1/src/shim/sync_fifo_1.vhd
add_fileset_file alt_async_fifo_1.vhd VHDL PATH ../../generic_ip/common/1/src/altera/alt_async_fifo_1.vhd
add_fileset_file inferred_async_fifo_1.vhd VHDL PATH ../../generic_ip/common/1/src/inferred/inferred_async_fifo_1.vhd
add_fileset_file async_fifo_1.vhd VHDL PATH ../../generic_ip/common/1/src/shim/async_fifo_1.vhd
add_fileset_file alt_dp_ram_1 VHDL PATH ../../generic_ip/common/1/src/altera/alt_dp_ram_1.vhd
add_fileset_file inferred_dpram_1.vhd VHDL PATH ../../generic_ip/common/1/src/inferred/inferred_dpram_1.vhd
add_fileset_file dp_ram_1.vhd VHDL PATH ../../generic_ip/common/1/src/shim/dp_ram_1.vhd
add_fileset_file alt_rw_dp_ram_1 VHDL PATH ../../generic_ip/common/1/src/altera/alt_rw_dp_ram_1.vhd
add_fileset_file rw_dp_ram_1.vhd VHDL PATH ../../generic_ip/common/1/src/shim/rw_dp_ram_1.vhd
add_fileset_file alt_sync_fifo.vhd VHDL PATH ../../generic_ip/common/0/src/altera/alt_sync_fifo.vhd
add_fileset_file ddr_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/ddr_tx_1.vhd
add_fileset_file lvds_ddr_tx_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/altera/lvds_ddr_tx_1.vhd
@ -63,12 +76,12 @@ add_fileset_file generic_pio_1.vhd VHDL PATH ../../generic_ip/generic_pio/1/src/
add_fileset_file swim_2_pkg_auto.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2_pkg_auto.vhd
add_fileset_file swim_2_csr_regs_auto.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2_csr_regs_auto.vhd
add_fileset_file swim_2.vhd VHDL PATH ../../generic_ip/swim/2/src/swim_2.vhd
add_fileset_file debug_wr_if.vhd VHDL PATH debug_wr_if.vhd
add_fileset_file dp_mem_5.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/altera/dp_mem_5.vhd
add_fileset_file hmb_fpga_cfg_5_pkg_auto.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5_pkg_auto.vhd
add_fileset_file hmb_fpga_cfg_5_csr_regs_auto.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5_csr_regs_auto.vhd
add_fileset_file hmb_fpga_cfg_5.vhd VHDL PATH ../../generic_ip/hmb_fpga_cfg/5/src/hmb_fpga_cfg_5.vhd
add_fileset_file generic_sequencer_15_pkg.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/generic_sequencer_15_pkg.vhd
add_fileset_file generic_seq_ram_15.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/altera/generic_seq_ram_15.vhd
add_fileset_file generic_sequencer_15.vhd VHDL PATH ../../generic_ip/generic_sequencer/15/src/generic_sequencer_15.vhd
add_fileset_file generic_delay_queue_1_pkg_auto.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/generic_delay_queue_1_pkg_auto.vhd
add_fileset_file fifo_delay_queue_1_ff.vhd VHDL PATH ../../generic_ip/generic_delay_queue/1/src/altera/fifo_delay_queue_1_ff.vhd
@ -84,21 +97,14 @@ add_fileset_file simple_frac_div_2.vhd VHDL PATH ../../generic_ip/pulse_generato
add_fileset_file pulse_generator_2.vhd VHDL PATH ../../generic_ip/pulse_generator/2/src/pulse_generator_2.vhd
add_fileset_file enc_pd_emul_1_pkg.vhd VHDL PATH ../../generic_ip/enc_pd_emul/1/src/enc_pd_emul_1_pkg.vhd
add_fileset_file enc_pd_emul_1.vhd VHDL PATH ../../generic_ip/enc_pd_emul/1/src/enc_pd_emul_1.vhd
add_fileset_file preslicer_fifo_0.vhd VHDL PATH ../../generic_ip/preslicer/0/src/altera/preslicer_fifo_0.vhd
add_fileset_file preslicer_0.vhd VHDL PATH ../../generic_ip/preslicer/0/src/preslicer_0.vhd
add_fileset_file pixel_buffer_0_pkg.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/pixel_buffer_0_pkg.vhd
add_fileset_file pixel_ram_0.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/altera/pixel_ram_0.vhd
add_fileset_file pixel_buffer_0.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/pixel_buffer_0.vhd
add_fileset_file gl_remap.vhd VHDL PATH ../../data_core/src/gl_remap.vhd
add_fileset_file slicer.vhd VHDL PATH ../../data_core/src/slicer.vhd
add_fileset_file data_core.vhd VHDL PATH ../../data_core/src/data_core.vhd
add_fileset_file print_unit_pkg_auto.vhd VHDL PATH ../../print_unit/src/print_unit_pkg_auto.vhd
add_fileset_file print_unit_csr_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_csr_decode_auto.vhd
add_fileset_file print_unit_seq_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_seq_decode_auto.vhd
add_fileset_file print_unit.vhd VHDL PATH ../../print_unit/src/print_unit.vhd
add_fileset_file cmd_queue_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/altera/cmd_queue_7.vhd
add_fileset_file tlb_queue_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/altera/tlb_queue_7.vhd
add_fileset_file data_streamer_7.vhd VHDL PATH ../../generic_ip/data_streamer/7/src/data_streamer_7.vhd
add_fileset_file streamer_log_7.vhd VHDL PATH ../../generic_ip/print_streamer/7/src/streamer_log_7.vhd
add_fileset_file print_streamer_pkg_auto.vhd VHDL PATH ../../print_streamer/src/print_streamer_pkg_auto.vhd
add_fileset_file data_streamer_pkg_auto.vhd VHDL PATH ../../print_streamer/src/data_streamer_pkg_auto.vhd
add_fileset_file avm_to_axi_master.vhd VHDL PATH ../../print_streamer/src/avm_to_axi_master.vhd
@ -108,7 +114,22 @@ add_fileset_file mem_arbiter.vhd VHDL PATH ../../print_streamer/src/mem_arbiter.
add_fileset_file streamer_queue_0.vhd VHDL PATH ../../generic_ip/streamer_fifo/0/src/altera/streamer_queue_0.vhd
add_fileset_file streamer_fifo_0.vhd VHDL PATH ../../generic_ip/streamer_fifo/0/src/streamer_fifo_0.vhd
add_fileset_file print_streamer.vhd VHDL PATH ../../print_streamer/src/print_streamer.vhd
add_fileset_file pixel_ram.vhd VHDL PATH ../../generic_ip/pixel_buffer/0/src/altera/pixel_ram_0.vhd
add_fileset_file pixel_buffer_2_pkg.vhd VHDL PATH ../../generic_ip/pixel_buffer/2/src/pixel_buffer_2_pkg.vhd
add_fileset_file pixel_buffer_2.vhd VHDL PATH ../../generic_ip/pixel_buffer/2/src/pixel_buffer_2.vhd
add_fileset_file pixel_buffer_zero_gap_2.vhd VHDL PATH ../../generic_ip/pixel_buffer/2/src/pixel_buffer_zero_gap_2.vhd
add_fileset_file slicer.vhd VHDL PATH ../../data_core/src/slicer.vhd
add_fileset_file preslicer.vhd VHDL PATH ../../data_core/src/preslicer.vhd
add_fileset_file preslicer_dual.vhd VHDL PATH ../../data_core/src/preslicer_dual.vhd
add_fileset_file gl_remap.vhd VHDL PATH ../../data_core/src/gl_remap.vhd
add_fileset_file data_core.vhd VHDL PATH ../../data_core/src/data_core.vhd
add_fileset_file dac_interface.vhd VHDL PATH ../../print_ctrl/src/dac_interface.vhd
add_fileset_file print_unit_pkg_auto.vhd VHDL PATH ../../print_unit/src/print_unit_pkg_auto.vhd
add_fileset_file print_unit_csr_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_csr_decode_auto.vhd
add_fileset_file print_unit_seq_decode_auto.vhd VHDL PATH ../../print_unit/src/print_unit_seq_decode_auto.vhd
add_fileset_file print_unit_pkg_auto.vhd VHDL PATH ../../print_unit/src/print_unit_pkg_auto.vhd
add_fileset_file print_unit_csr_regs_auto.vhd VHDL PATH ../../print_unit/src/print_unit_csr_regs_auto.vhd
add_fileset_file print_unit.vhd VHDL PATH ../../print_unit/src/print_unit.vhd
add_fileset_file print_ctrl_csr_decode_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_csr_decode_auto.vhd
add_fileset_file print_ctrl_seq_decode_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_seq_decode_auto.vhd
add_fileset_file print_ctrl_pkg_auto.vhd VHDL PATH ../../print_ctrl/src/print_ctrl_pkg_auto.vhd
@ -120,25 +141,59 @@ add_fileset_file shutdown_monitor_0.vhd VHDL PATH ../../generic_ip/shutdown_moni
add_fileset_file lvds_rx_1ck_16d.vhd VHDL PATH ../../hmb_fpga_top/build/ip/lvds_rx_1ck_16d.vhd
add_fileset_file pwm.vhd VHDL PATH ../../pwm/src/pwm.vhd
add_fileset_file freq_counter.vhd VHDL PATH ../../freq_counter/src/freq_counter.vhd
add_fileset_file constant_latency_if.vhd VHDL PATH constant_latency_if.vhd
add_fileset_file cs_bus_itf.vhd VHDL PATH ../../generic_ip/common/0/src/cs_bus_itf.vhd
add_fileset_file constant_latency_if.vhd VHDL PATH ../../generic_ip/common/0/src/constant_latency_if.vhd
add_fileset_file sync_fifo.vhd VHDL PATH ../../generic_ip/common/0/src/altera/sync_fifo.vhd
add_fileset_file lut_divider_0.vhd VHDL PATH ../../generic_ip/encoder_multiply/0/src/lut_divider_0.vhd
add_fileset_file encoder_speed_detect_0.vhd VHDL PATH ../../generic_ip/encoder_multiply/0/src/encoder_speed_detect_0.vhd
add_fileset_file encoder_multiply_0.vhd VHDL PATH ../../generic_ip/encoder_multiply/0/src/encoder_multiply_0.vhd
add_fileset_file digital_lpf.vhd VHDL PATH ../../generic_ip/common/0/src/digital_lpf.vhd
add_fileset_file ems_1_pkg_auto.vhd VHDL PATH ../../generic_ip/ems/1/src/ems_1_pkg_auto.vhd
add_fileset_file ems_1csr_regs_auto.vhd VHDL PATH ../../generic_ip/ems/1/src/ems_1_csr_regs_auto.vhd
add_fileset_file ems_1.vhd VHDL PATH ../../generic_ip/ems/1/src/ems_1.vhd
add_fileset_file sync_pulse.vhd VHDL PATH ../../generic_ip/common/0/src/sync_pulse.vhd
add_fileset_file sync_pulse_vec_push.vhd VHDL PATH ../../generic_ip/common/0/src/sync_pulse_vec_push.vhd
add_fileset_file sync_wire.vhd VHDL PATH ../../generic_ip/common/0/src/sync_wire.vhd
add_fileset_file sync_wire_rEdge.vhd VHDL PATH ../../generic_ip/common/0/src/sync_wire_rEdge.vhd
add_fileset_file uart_rx.vhd VHDL PATH ../../generic_ip/common/0/src/uart_rx.vhd
add_fileset_file pof_uart_rx_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_uart_rx_0.vhd
add_fileset_file pof_rx_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_rx_0.vhd
add_fileset_file pof_uart_regen_0.vhd VHDL PATH ../../generic_ip/pof_protocol/0/src/pof_uart_regen_0.vhd
add_fileset_file pof_uart_rx_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_uart_rx_1.vhd
add_fileset_file pof_rx_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_rx_1.vhd
add_fileset_file pof_uart_regen_1.vhd VHDL PATH ../../generic_ip/pof_protocol/1/src/pof_uart_regen_1.vhd
add_fileset_file event_logger_0_pkg.vhd VHDL PATH ../../generic_ip/event_logger/0/src/event_logger_0_pkg.vhd
add_fileset_file event_logger_0.vhd VHDL PATH ../../generic_ip/event_logger/0/src/event_logger_0.vhd
add_fileset_file simple_enc_vel_detect_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/simple_enc_vel_detect_4.vhd
add_fileset_file smb_diagnostics_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/smb_diagnostics_4.vhd
add_fileset_file fire_pulse_4_pkg.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_4_pkg.vhd
add_fileset_file fire_pulse_ctrl_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_ctrl_4.vhd
add_fileset_file fire_pulse_ext_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_ext_4.vhd
add_fileset_file fire_pulse_manager_4.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/4/src/fire_pulse_manager_4.vhd
add_fileset_file pof_uart_rx_2.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_uart_rx_2.vhd
add_fileset_file uart_tx_2.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/uart_tx_2.vhd
add_fileset_file pof_tx_2_pkg_auto.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_tx_2_pkg_auto.vhd
add_fileset_file pof_tx_2_csr_regs_auto.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_tx_2_csr_regs_auto.vhd
add_fileset_file pof_rx_2.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_rx_2.vhd
add_fileset_file pof_tx_2.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_tx_2.vhd
add_fileset_file pof_uart_regen_2.vhd VHDL PATH ../../generic_ip/pof_protocol/2/src/pof_uart_regen_2.vhd
add_fileset_file fifo_1024x32.vhd VHDL PATH ../../generic_ip/common/0/src/altera/fifo_1024x32.vhd
add_fileset_file fifo_256x32.vhd VHDL PATH ../../generic_ip/common/0/src/altera/fifo_256x32.vhd
add_fileset_file cs_bus_itf_no_wait.vhd VHDL PATH ../../generic_ip/common/0/src/cs_bus_itf_no_wait.vhd
add_fileset_file dpram_sclk.vhd VHDL PATH ../../generic_ip/common/0/src/dpram_sclk.vhd
add_fileset_file generic_sequencer_18_pkg_auto.vhd VHDL PATH ../../generic_ip/generic_sequencer/18/src/generic_sequencer_18_pkg_auto.vhd
add_fileset_file generic_sequencer_18_cmd_pkg.vhd VHDL PATH ../../generic_ip/generic_sequencer/18/src/generic_sequencer_18_cmd_pkg.vhd
add_fileset_file generic_sequencer_18_csr_regs_auto.vhd VHDL PATH ../../generic_ip/generic_sequencer/18/src/generic_sequencer_18_csr_regs_auto.vhd
add_fileset_file generic_sequencer_18_seq_regs_auto.vhd VHDL PATH ../../generic_ip/generic_sequencer/18/src/generic_sequencer_18_seq_regs_auto.vhd
add_fileset_file generic_sequencer_18.vhd VHDL PATH ../../generic_ip/generic_sequencer/18/src/generic_sequencer_18.vhd
add_fileset_file enc_pd_emul_2_pkg_auto.vhd VHDL PATH ../../generic_ip/enc_pd_emul/2/src/enc_pd_emul_2_pkg_auto.vhd
add_fileset_file enc_pd_emul_2_csr_regs_auto.vhd VHDL PATH ../../generic_ip/enc_pd_emul/2/src/enc_pd_emul_2_csr_regs_auto.vhd
add_fileset_file enc_pd_emul_2.vhd VHDL PATH ../../generic_ip/enc_pd_emul/2/src/enc_pd_emul_2.vhd
add_fileset_file event_logger_1_pkg_auto.vhd VHDL PATH ../../generic_ip/event_logger/1/src/event_logger_1_pkg_auto.vhd
add_fileset_file event_logger_1_csr_regs_auto.vhd VHDL PATH ../../generic_ip/event_logger/1/src/event_logger_1_csr_regs_auto.vhd
add_fileset_file event_logger_1.vhd VHDL PATH ../../generic_ip/event_logger/1/src/event_logger_1.vhd
add_fileset_file queue_and_delay.vhd VHDL PATH ../../generic_ip/common/0/src/queue_and_delay.vhd
add_fileset_file simple_frac_div_5.vhd VHDL PATH ../../generic_ip/pulse_generator/5/src/simple_frac_div_5.vhd
add_fileset_file pulse_generator_5_pkg_auto.vhd VHDL PATH ../../generic_ip/pulse_generator/5/src/pulse_generator_5_pkg_auto.vhd
add_fileset_file pulse_generator_5_csr_regs_auto.vhd VHDL PATH ../../generic_ip/pulse_generator/5/src/pulse_generator_5_csr_regs_auto.vhd
add_fileset_file pulse_generator_5.vhd VHDL PATH ../../generic_ip/pulse_generator/5/src/pulse_generator_5.vhd
add_fileset_file fpm_ctrl_7_pkg_auto.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/fpm_ctrl_7_pkg_auto.vhd
add_fileset_file epd_diags_7_pkg_auto.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/epd_diags_7_pkg_auto.vhd
add_fileset_file fpm_ctrl_7_csr_regs_auto.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/fpm_ctrl_7_csr_regs_auto.vhd
add_fileset_file epd_diags_7_csr_regs_auto.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/epd_diags_7_csr_regs_auto.vhd
add_fileset_file epd_diagnostics_7.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/epd_diagnostics_7.vhd
add_fileset_file seb_epd_led_gen_7.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/seb_epd_led_gen_7.vhd
add_fileset_file fire_pulse_7_pkg.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/fire_pulse_7_pkg.vhd
add_fileset_file simple_enc_vel_detect_7.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/simple_enc_vel_detect_7.vhd
add_fileset_file fire_pulse_ctrl_7.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/fire_pulse_ctrl_7.vhd
add_fileset_file fire_pulse_manager_7.vhd VHDL PATH ../../generic_ip/fire_pulse_manager/7/src/fire_pulse_manager_7.vhd
add_fileset_file top_pkg.vhd VHDL PATH top_pkg.vhd
add_fileset_file core_pkg_auto.vhd VHDL PATH core_pkg_auto.vhd
add_fileset_file core_csr_decode_auto.vhd VHDL PATH core_csr_decode_auto.vhd
@ -147,9 +202,9 @@ add_fileset_file core_seq_decode_auto.vhd VHDL PATH core_seq_decode_auto.vhd
add_fileset_file core.vhd VHDL PATH core.vhd TOP_LEVEL_FILE
#
#
# parameters
#
#
add_parameter MAX_HEADS INTEGER 4
set_parameter_property MAX_HEADS DEFAULT_VALUE 4
set_parameter_property MAX_HEADS DISPLAY_NAME MAX_HEADS
@ -297,18 +352,30 @@ set_parameter_property CLK_FREQ_MHZ TYPE INTEGER
set_parameter_property CLK_FREQ_MHZ UNITS None
set_parameter_property CLK_FREQ_MHZ ALLOWED_RANGES -2147483648:2147483647
set_parameter_property CLK_FREQ_MHZ HDL_PARAMETER true
add_parameter SLIM BOOLEAN false
set_parameter_property SLIM DEFAULT_VALUE false
set_parameter_property SLIM DISPLAY_NAME SLIM
set_parameter_property SLIM TYPE BOOLEAN
set_parameter_property SLIM UNITS None
set_parameter_property SLIM HDL_PARAMETER true
add_parameter NO_ZERO_GAP BOOLEAN true
set_parameter_property NO_ZERO_GAP DEFAULT_VALUE true
set_parameter_property NO_ZERO_GAP DISPLAY_NAME NO_ZERO_GAP
set_parameter_property NO_ZERO_GAP TYPE BOOLEAN
set_parameter_property NO_ZERO_GAP UNITS None
set_parameter_property NO_ZERO_GAP HDL_PARAMETER true
add_parameter DYNAMIC_COMBINE BOOLEAN true
set_parameter_property DYNAMIC_COMBINE DEFAULT_VALUE true
set_parameter_property DYNAMIC_COMBINE DISPLAY_NAME DYNAMIC_COMBINE
set_parameter_property DYNAMIC_COMBINE TYPE BOOLEAN
set_parameter_property DYNAMIC_COMBINE UNITS None
set_parameter_property DYNAMIC_COMBINE HDL_PARAMETER true
add_parameter SEB_EPD_ENABLE BOOLEAN true
set_parameter_property SEB_EPD_ENABLE DEFAULT_VALUE true
set_parameter_property SEB_EPD_ENABLE DISPLAY_NAME SEB_EPD_ENABLE
set_parameter_property SEB_EPD_ENABLE TYPE BOOLEAN
set_parameter_property SEB_EPD_ENABLE UNITS None
set_parameter_property SEB_EPD_ENABLE HDL_PARAMETER true
add_parameter STREAMER_LOGGER BOOLEAN false
set_parameter_property STREAMER_LOGGER DEFAULT_VALUE false
set_parameter_property STREAMER_LOGGER DISPLAY_NAME STREAMER_LOGGER
set_parameter_property STREAMER_LOGGER TYPE BOOLEAN
set_parameter_property STREAMER_LOGGER UNITS None
set_parameter_property STREAMER_LOGGER HDL_PARAMETER true
add_parameter SIM_TEST_MODE BOOLEAN false
set_parameter_property SIM_TEST_MODE DEFAULT_VALUE false
set_parameter_property SIM_TEST_MODE DISPLAY_NAME SIM_TEST_MODE
@ -317,14 +384,14 @@ set_parameter_property SIM_TEST_MODE UNITS None
set_parameter_property SIM_TEST_MODE HDL_PARAMETER true
#
#
# display items
#
#
#
#
# connection point clock
#
#
add_interface clock clock end
set_interface_property clock clockRate 0
set_interface_property clock ENABLED true
@ -336,9 +403,9 @@ set_interface_property clock SVD_ADDRESS_GROUP ""
add_interface_port clock clk clk Input 1
#
#
# connection point reset
#
#
add_interface reset reset end
set_interface_property reset associatedClock clock
set_interface_property reset synchronousEdges DEASSERT
@ -351,9 +418,9 @@ set_interface_property reset SVD_ADDRESS_GROUP ""
add_interface_port reset reset_n reset_n Input 1
#
#
# connection point csr
#
#
add_interface csr avalon end
set_interface_property csr addressUnits WORDS
set_interface_property csr associatedClock clock
@ -390,9 +457,9 @@ set_interface_assignment csr embeddedsw.configuration.isNonVolatileStorage 0
set_interface_assignment csr embeddedsw.configuration.isPrintableDevice 0
#
#
# connection point seq
#
#
add_interface seq avalon end
set_interface_property seq addressUnits WORDS
set_interface_property seq associatedClock clock
@ -427,9 +494,9 @@ set_interface_assignment seq embeddedsw.configuration.isNonVolatileStorage 0
set_interface_assignment seq embeddedsw.configuration.isPrintableDevice 0
#
#
# connection point lvds_tx
#
#
add_interface lvds_tx conduit end
set_interface_property lvds_tx associatedClock clock
set_interface_property lvds_tx associatedReset ""
@ -443,9 +510,9 @@ add_interface_port lvds_tx lvds_tx_ser ser Output "(lvds_tx_chans) - (0) + 1"
add_interface_port lvds_tx lvds_tx_pio pio Output num_lvds_tx_pio
#
#
# connection point pio
#
#
add_interface pio conduit end
set_interface_property pio associatedClock clock
set_interface_property pio associatedReset ""
@ -460,10 +527,25 @@ add_interface_port pio pio_out_en pio_out_en Output num_pio
add_interface_port pio pio_in pio_in Input num_pio
add_interface_port pio ddr_out ddr_out Output num_ddr
#
# connection point ic2_ctrl_stat
#
add_interface i2c conduit end
set_interface_property i2c associatedClock clock
set_interface_property i2c associatedReset ""
set_interface_property i2c ENABLED true
set_interface_property i2c EXPORT_OF ""
set_interface_property i2c PORT_NAME_MAP ""
set_interface_property i2c CMSIS_SVD_VARIABLES ""
set_interface_property i2c SVD_ADDRESS_GROUP ""
#
add_interface_port i2c i2c_ctrl i2c_ctrl Output 32
add_interface_port i2c i2c_stat i2c_stat Input 32
#
# connection point swim
#
#
add_interface swim conduit end
set_interface_property swim associatedClock clock
set_interface_property swim associatedReset ""
@ -477,9 +559,9 @@ add_interface_port swim STM8_SWIM_OUT tx Output 5
add_interface_port swim STM8_SWIM_IN rx Input 5
#
#
# connection point fpga_cfg
#
#
add_interface fpga_cfg conduit end
set_interface_property fpga_cfg associatedClock clock
set_interface_property fpga_cfg associatedReset reset
@ -498,9 +580,9 @@ add_interface_port fpga_cfg cfg_init_done init_done Input 1
add_interface_port fpga_cfg cfg_oe oe Output 1
#
#
# connection point dac
#
#
add_interface dac conduit end
set_interface_property dac associatedClock clock
set_interface_property dac associatedReset ""
@ -514,9 +596,9 @@ add_interface_port dac dac_data_0 data_0 Output 15
add_interface_port dac dac_data_1 data_1 Output 15
#
#
# connection point irq
#
#
add_interface irq interrupt end
set_interface_property irq associatedAddressablePoint ""
set_interface_property irq associatedClock clock
@ -532,9 +614,9 @@ set_interface_property irq SVD_ADDRESS_GROUP ""
add_interface_port irq pwr_seq_irq irq Output 1
#
#
# connection point clk_x2
#
#
add_interface clk_x2 clock end
set_interface_property clk_x2 clockRate 0
set_interface_property clk_x2 ENABLED true
@ -546,9 +628,9 @@ set_interface_property clk_x2 SVD_ADDRESS_GROUP ""
add_interface_port clk_x2 clk_x2 clk Input 1
#
#
# connection point clk_fpm_rx
#
#
add_interface clk_fpm_rx clock end
set_interface_property clk_fpm_rx clockRate 0
set_interface_property clk_fpm_rx ENABLED true
@ -560,9 +642,9 @@ set_interface_property clk_fpm_rx SVD_ADDRESS_GROUP ""
add_interface_port clk_fpm_rx clk_fpm_rx clk Input 1
#
#
# connection point clk_half
#
#
add_interface clk_half clock end
set_interface_property clk_half clockRate 0
set_interface_property clk_half ENABLED true
@ -574,9 +656,9 @@ set_interface_property clk_half SVD_ADDRESS_GROUP ""
add_interface_port clk_half clk_half clk Input 1
#
#
# connection point debug
#
#
add_interface debug conduit end
set_interface_property debug associatedClock clock
set_interface_property debug associatedReset ""
@ -589,9 +671,9 @@ set_interface_property debug SVD_ADDRESS_GROUP ""
add_interface_port debug debug_out output Output 5
#
#
# connection point TIMING
#
#
add_interface TIMING conduit end
set_interface_property TIMING associatedClock clock
set_interface_property TIMING associatedReset ""
@ -603,13 +685,15 @@ set_interface_property TIMING SVD_ADDRESS_GROUP ""
add_interface_port TIMING TIMING_TX_N tx_n Input 1
add_interface_port TIMING TIMING_RX_P rx_p Input 1
add_interface_port TIMING TIMING_TX_P tx_p Output 1
add_interface_port TIMING TIMING_RX_N rx_n Output 1
add_interface_port TIMING TIMING_TX_P_in tx_p_in Input 1
add_interface_port TIMING TIMING_TX_P_out tx_p_out Output 1
add_interface_port TIMING TIMING_TX_P_oe tx_p_oe Output 1
#
#
# connection point rx
#
#
add_interface rx axi4 start
set_interface_property rx associatedClock clock
set_interface_property rx associatedReset reset
@ -645,10 +729,42 @@ add_interface_port rx axm_rdata rdata Input 32
add_interface_port rx axm_rvalid rvalid Input 1
add_interface_port rx axm_rready rready Output 1
#
# connection point tx
#
add_interface tx avalon start
set_interface_property tx addressUnits SYMBOLS
set_interface_property tx associatedClock clock
set_interface_property tx associatedReset reset
set_interface_property tx bitsPerSymbol 8
set_interface_property tx burstOnBurstBoundariesOnly false
set_interface_property tx burstcountUnits WORDS
set_interface_property tx doStreamReads false
set_interface_property tx doStreamWrites false
set_interface_property tx holdTime 0
set_interface_property tx linewrapBursts false
set_interface_property tx maximumPendingReadTransactions 0
set_interface_property tx maximumPendingWriteTransactions 0
set_interface_property tx readLatency 0
set_interface_property tx readWaitTime 1
set_interface_property tx setupTime 0
set_interface_property tx timingUnits Cycles
set_interface_property tx writeWaitTime 0
set_interface_property tx ENABLED true
set_interface_property tx EXPORT_OF ""
set_interface_property tx PORT_NAME_MAP ""
set_interface_property tx CMSIS_SVD_VARIABLES ""
set_interface_property tx SVD_ADDRESS_GROUP ""
#
add_interface_port tx avm_tx_waitrequest waitrequest Input 1
add_interface_port tx avm_tx_burstcount burstcount Output 12
add_interface_port tx avm_tx_address address Output 32
add_interface_port tx avm_tx_write write Output 1
add_interface_port tx avm_tx_writedata writedata Output 64
#
# connection point pwm
#
#
add_interface pwm conduit end
set_interface_property pwm associatedClock clock
set_interface_property pwm associatedReset reset
@ -663,9 +779,9 @@ add_interface_port pwm pwm_out_heat out_heat Output 4
add_interface_port pwm fan_sense fan_sense Input 1
#
#
# connection point hv_clk
#
#
add_interface hv_clk conduit end
set_interface_property hv_clk associatedClock clock
set_interface_property hv_clk associatedReset reset

View file

@ -0,0 +1,335 @@
-------------------------------------------------------------------------------
-- Title : debug_wr_if
-- Project :
-------------------------------------------------------------------------------
-- File : debug_wr_if.vhd
-- Author :
-- Company : Global Inkjet Systems
-- Created : 2024-3-13
-- Last update:
-- Standard : VHDL'2008
-------------------------------------------------------------------------------
-- Description:
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
use work.common_pkg.all;
entity debug_wr_if is
generic (
MAX_BURST_SIZE : natural range 1 to 128 := 8;
MAX_HEADS : natural range 1 to 4 := 4;
AUTO_FLUSH_CNT_WIDTH : natural range 3 to 15 := 13 -- 80 us
);
port (
clk : in std_logic;
rst_n : in std_logic;
-- Control and status
enable : in std_logic;
clr : in std_logic;
trig_on_underrun : in std_logic;
trig_on_dbl_drop : in std_logic;
trig_now : in std_logic;
update_addr : in std_logic;
new_base_addr_bytes : in std_logic_vector(31 downto 0);
new_end_addr_bytes : in std_logic_vector(31 downto 0);
bytes_written : out std_logic_vector(31 downto 0);
overflow : out std_logic;
wr_addr : out std_logic_vector(31 downto 0);
triggered : out std_logic;
write_busy : out std_logic;
-- Data to monitor
underrun : in std_logic_vector(MAX_HEADS - 1 downto 0);
dbl_drop : in std_logic_vector(MAX_HEADS - 1 downto 0);
clear_buffer : in std_logic_vector(MAX_HEADS - 1 downto 0);
fire_pulse : in std_logic_vector(MAX_HEADS - 1 downto 0);
pof_rx_debug : in std_logic_vector(31 downto 0);
-- Avalon Master burst write interface for FPGA configuration block
avm_tx_write : out std_logic;
avm_tx_waitrequest : in std_logic;
avm_tx_burstcount : out std_logic_vector(11 downto 0) := (others => '0');
avm_tx_address : out std_logic_vector(31 downto 0); -- byte address
avm_tx_writedata : out std_logic_vector(63 downto 0);
avm_tx_last : out std_logic
);
end entity debug_wr_if;
architecture rtl of debug_wr_if is
constant DEFAULT_START_QADDR : std_logic_vector(31 downto 3) := 29x"4000000"; -- 0x20000000 byte address
constant DEFAULT_END_QADDR : std_logic_vector(31 downto 3) := 29x"4001fff"; -- 0x2000fff8 byte address
constant BURST_TOP_BIT : integer := log2(MAX_BURST_SIZE);
constant WHOLE_WORD_BIT : integer := 64;
type array_t is array (natural range <>) of std_logic_vector;
signal wrreq : std_logic;
signal wrdata : std_logic_vector(63 downto 0);
signal rdreq : std_logic;
signal almost_full : std_logic;
signal full : std_logic;
signal empty : std_logic;
signal usedw : std_logic_vector(log2(MAX_BURST_SIZE*2)-1 downto 0);
signal rddata : std_logic_vector(63 downto 0);
-- Buffer QWORD addresses
signal start_addr : std_logic_vector(31 downto 3);
signal end_addr : std_logic_vector(31 downto 3);
signal addr : std_logic_vector(31 downto 3);
signal burstcount : std_logic_vector(BURST_TOP_BIT downto 0);
signal auto_flush_cnt : std_logic_vector(AUTO_FLUSH_CNT_WIDTH-1 downto 0);
signal auto_flush : std_logic;
signal auto_flush_dly : std_logic;
signal event_in : std_logic_vector(31 downto 0);
signal event_det_sr : array_t(3 downto 1)(31 downto 0);
signal curr_time : std_logic_vector(30 downto 0);
signal trigger_sr : std_logic_vector(5 downto 1);
begin
-----------------------------------------------------------------------------
-- Short queue to gather up words into sensible burst sizes
-----------------------------------------------------------------------------
P_WRITE : process(clk, rst_n)
begin
if rst_n = '0' then
wrreq <= '0';
curr_time <= (others => '0');
trigger_sr <= (others => '0');
triggered <= '0';
elsif clk'event and clk = '1' then
wrreq <= '0';
event_det_sr <= event_det_sr(event_det_sr'high-1 downto 1) & event_in;
if enable = '1' and triggered = '0' then
for i in 5 to 29 loop
if event_det_sr(1)(i) = '1' and event_det_sr(2)(i) = '0' then -- Only store when bit going active (rising)
wrreq <= '1';
end if;
end loop;
end if;
if clr = '1' then
curr_time <= (others => '0');
else
curr_time <= std_logic_vector(unsigned(curr_time)+1);
end if;
--pragma translate_off
--if curr_time(7 downto 0) = x"FF" then
--wrreq <= enable and not triggered;
--end if;
--pragma translate_on
if clr = '1' then
trigger_sr <= (others => '0');
else
trigger_sr(trigger_sr'high downto 2) <= trigger_sr(trigger_sr'high-1 downto 1);
trigger_sr(1) <= '0';
if underrun /= x"0" and trig_on_underrun = '1' then
trigger_sr(1) <= '1';
end if;
if dbl_drop /= x"0" and trig_on_dbl_drop = '1' then
trigger_sr(1) <= '1';
end if;
if trig_now = '1' then
trigger_sr(1) <= '1';
end if;
end if;
if clr = '1' then
triggered <= '0';
else
if trigger_sr(trigger_sr'high) = '1' then
triggered <= '1';
end if;
end if;
end if;
end process;
event_in <=("00" -- 31:30
& underrun -- 29:26
& dbl_drop -- 25:22
& fire_pulse -- 21:18
& pof_rx_debug(17 downto 0)); -- 17:0
wrdata(63) <= '0';
wrdata(62 downto 32) <= curr_time(30 downto 0);
wrdata(31) <= '1';
wrdata(30) <= '0';
wrdata(29 downto 0) <= event_det_sr(3)(29 downto 0);
--debug_out(17) <= clear;
--debug_out(16) <= sync;
--debug_out(15 downto 8) <= abs_pos_i(7 downto 0);
--debug_out(7) <= inc_pos_ii;
--debug_out(6) <= dec_pos_ii;
--debug_out(5) <= pd;
--debug_out(4) <= symbol_valid_i;
--debug_out(3 downto 0) <= next_pos_lsb;
ip_fifo_inst : entity work.alt_sync_fifo
generic map
(
DATA_WIDTH => 64,
DEPTH => MAX_BURST_SIZE*2,
REGISTER_OUTPUT => "ON",
NEARLY_FULL => MAX_BURST_SIZE*2-4,
SHOWAHEAD => "ON"
)
port map
(
clk => clk,
rst_n => rst_n,
sclr => clr,
wrreq => wrreq,
wrdata => wrdata,
almost_full => almost_full,
full => full,
rdreq => rdreq,
rddata => rddata,
empty => empty,
usedw => usedw
);
-----------------------------------------------------------------------------
-- Combinatorial logic
-----------------------------------------------------------------------------
wr_addr <= addr & "000";
-- Read from the queue whenever a write over the bus happens (and not stalled), and input queue is not empty.
rdreq <= avm_tx_write and not avm_tx_waitrequest and not empty;
-- Write data on Avalon bus is the registered output of the Input queue.
avm_tx_writedata <= rddata;
-----------------------------------------------------------------------------
-- Synchronous process
-----------------------------------------------------------------------------
P_SYNC : process(clk, rst_n)
begin
if rst_n = '0' then
overflow <= '0';
burstcount <= (others => '0');
addr <= DEFAULT_START_QADDR;
start_addr <= DEFAULT_START_QADDR;
end_addr <= DEFAULT_END_QADDR;
auto_flush_cnt <= (others => '1');
auto_flush <= '0';
bytes_written <= (others => '0');
write_busy <= '0';
elsif clk'event and clk = '1' then
-- Default the Avalon writes to inactive
avm_tx_write <= '0';
avm_tx_last <= '0';
auto_flush <= '0';
auto_flush_dly <= auto_flush;
-- If a partial word waiting on the input or partial burst in the queue, start counting down the auto-flush timer
if (empty = '0' and unsigned(usedw) < MAX_BURST_SIZE) then
auto_flush_cnt <= std_logic_vector(unsigned(auto_flush_cnt) - 1);
-- If the counter expires, force an auto-flush
if unsigned(auto_flush_cnt) = 0 then
auto_flush <= '1';
end if;
else
-- When not at partial word boundaries, reset the auto-flush counter
auto_flush_cnt <= (others => '1');
end if;
-- If a write to a full queue is seen, flag an overflow.
if full = '1' and wrreq = '1' then
overflow <= '1';
end if;
-- If a write is not active ...
if unsigned(burstcount) = 0 then
-- If the maximum burst size amount of data is available then send a block of data
if unsigned(usedw) >= MAX_BURST_SIZE or full = '1' then
avm_tx_burstcount(BURST_TOP_BIT downto 0) <= std_logic_vector(to_unsigned(MAX_BURST_SIZE, BURST_TOP_BIT+1));
burstcount <= std_logic_vector(to_unsigned(MAX_BURST_SIZE, burstcount'length));
avm_tx_write <= '1';
avm_tx_address <= addr & "000";
-- If flushing and and data available, and no new data arriving, send the remaining words.
elsif empty = '0' and auto_flush_dly = '1' then
avm_tx_burstcount <= std_logic_vector(resize(unsigned(usedw), avm_tx_burstcount'length));
burstcount <= std_logic_vector(resize(unsigned(usedw), burstcount'length));
avm_tx_write <= '1';
avm_tx_address <= addr & "000";
end if;
-- Else a write to memory is active ...
else
-- Assert write and update the write data from the input queue
avm_tx_write <= '1';
-- If bus not stalled ...
if avm_tx_waitrequest = '0' then
-- Decrement the burst count
burstcount <= std_logic_vector(unsigned(burstcount) - 1);
if addr = end_addr then
addr <= start_addr;
else
addr <= std_logic_vector(unsigned(addr) + 1);
end if;
if bytes_written /= x"FFFFFFF8" then -- don't roll over
bytes_written <= std_logic_vector(unsigned(bytes_written) + 8);
end if;
-- If burst count is 2, flag next word (at count 1) as the last
if unsigned(burstcount) = 2 then
avm_tx_last <= '1';
elsif unsigned(burstcount) = 1 then
avm_tx_write <= '0';
end if;
end if;
end if;
write_busy <= '0';
if empty = '0' or unsigned(burstcount) /= 0 then
write_busy <= '1';
end if;
-- If requested, update the start and end addresses and reset the address counter to the new start
if update_addr = '1' then
addr <= new_base_addr_bytes(31 downto 3);
start_addr <= new_base_addr_bytes(31 downto 3);
end_addr <= new_end_addr_bytes(31 downto 3);
end if;
-- If cleared reset internal state
if clr = '1' then
burstcount <= (others => '0');
overflow <= '0';
addr <= DEFAULT_START_QADDR;
start_addr <= DEFAULT_START_QADDR;
end_addr <= DEFAULT_END_QADDR;
auto_flush_cnt <= (others => '1');
auto_flush <= '0';
bytes_written <= (others => '0');
end if;
end if;
end process;
end rtl;

View file

@ -0,0 +1,25 @@
-------------------------------------------------------------------------------
-- Title : SOM FPGA top level package
-- Project : sg1024
-------------------------------------------------------------------------------
-- File : sg1024_pkg.vhd
-- Author : Dave Steele
-- Company : Global Inkjet Systems
-- Created : 2024-01-29
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block is the common package for the SOM board FPGA on the sg1024
-------------------------------------------------------------------------------
-- Copyright (c) 2024 Global Inkjet Systems
-------------------------------------------------------------------------------
library ieee;
use ieee.std_logic_1164.all;
package sg1024_pkg is
type fpm_vec_t is array (natural range <>) of std_logic_vector(31 downto 0);
end package sg1024_pkg;

View file

@ -1,3 +1,4 @@
@REM Directories
@set FWTOOLSDIR=..\..\..\..\..\fw_development_tools\logic_memory_mapper
@set LIBDOCDIR=..\..\..\..\..\fw_development_tools\verification\lib\hdl\doc
@set REPODIR=..\..\..\..
@ -12,10 +13,13 @@
@py -3 %FWTOOLSDIR%\gen_elhal.py -j %LIBDOCDIR%\print_rx.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -j %LIBDOCDIR%\uart_tx.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -j %LIBDOCDIR%\fpga.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_elhal.py -r ..\..\..\.. -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_htm.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr
@py -3 %FWTOOLSDIR%\gen_elhal.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_hdl.py -j ..\..\..\hmb_fpga_top\doc\hmb_fpga.json -b csr -s _auto
@REM Add project specific build here. Normally just point to top of the repository for hierarchical scan
@py -3 %FWTOOLSDIR%\gen_elhal.py -r %REPODIR% -b csr -o .\src\hal
@py -3 %FWTOOLSDIR%\gen_hdl.py -r %REPODIR% -b csr seq avalon_slave_0 -s _auto
@py -3 %FWTOOLSDIR%\gen_htm.py -r %REPODIR% -b csr seq -B
@py -3 %FWTOOLSDIR%\gen_json.py -r %REPODIR% -b csr seq -s _auto -o %REPODIR%\firmware\top\doc

View file

@ -1,5 +1,11 @@
# Compile the code into the appropriate libraries
foreach lib [list work tb_pkg] {
file delete -force -- $lib
vlib $lib
}
vlog -quiet -f files_core_vlog_auto.tcl -work work
vcom -quiet -2008 -f files_core_auto.tcl -work work
vcom -quiet -2008 -f files_core_auto.tcl -f files.tcl -work work
vlog -quiet -f files_vlog.tcl -work work
vcom -quiet -2008 -f files.tcl -work work

View file

@ -120,7 +120,7 @@
},
"config" : {
"address" : "5",
"width" : "26",
"width" : "27",
"description" : "Status register for reading testbench configuration",
"fields": {
"max_op_width" : {
@ -152,7 +152,13 @@
"bit_len" : "1",
"reset" : "0",
"description" : "Configured dynamic super-head combine support"
}
},
"no_zero_gap" : {
"type" : "r",
"bit_len" : "1",
"reset" : "0",
"description" : "Configured for no zero gap support"
}
}
},
"swim_rx_shift_lo" : {
@ -242,6 +248,13 @@
"type" : "r",
"reset" : "0",
"description" : "Fire request count"
}
},
"scratch" : {
"address" : "17",
"width" : "32",
"type" : "w",
"reset" : "0",
"description" : "Scratch Reg to debug sim"
}
}
}]

View file

@ -2,21 +2,19 @@
# If you update this file, also update ../../sim/comp.do
# ------------------------------------------------------
../top_pkg.vhd
../constant_latency_if.vhd
../core_pkg_auto.vhd
../core_csr_decode_auto.vhd
../core_csr_regs_auto.vhd
../core_seq_decode_auto.vhd
../core.vhd
tb_pkg.vhd
./test_pkg_auto.vhd
./test_csr_decode_auto.vhd
./test_csr_regs_auto.vhd
../../../hmb_fpga_top/src/hmb_fpga_pkg_auto.vhd
../../../hmb_fpga_top/src/hmb_fpga_csr_decode_auto.vhd
../../../hmb_fpga_top/src/hmb_fpga_csr_regs_auto.vhd
../../../hmb_fpga_top/src/hmb_head_monitor.vhd
../../../hmb_fpga_top/build/ip/pll_25in_100out.vhd
../../../hmb_fpga_top/build/ip/io_buf_i2c.vhd
../../../hmb_fpga_top/build/ip/lvds_rx_1ck_16d.vhd
../../../hmb_fpga_top/src/hmb_fpga_top.vhd
../../../../../fw_development_tools/verification/tb_template/test/tb_ctrl.vhd
../../../../../fw_development_tools/verification/vproc/vproc_pkg.vhd
../../../../../fw_development_tools/verification/vproc/vproc.vhd

View file

@ -2,8 +2,9 @@
# #########################################
# Add project specific verilog files here
../../../hmb_fpga_top/src/simple_i2c_slave.v
../../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_counters_3.v
../../../generic_ip/uart_1MBd/3/src/altera/altera_up_sync_fifo_3.v
../../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_in_deserializer_3.v
../../../generic_ip/uart_1MBd/3/src/altera/altera_up_rs232_out_serializer_3.v
../../../generic_ip/uart_1MBd/3/src/altera/uart_1MBd_rs232_3.v
../../../generic_ip/uart_1MBd/3/src/altera/uart_1MBd_rs232_3.v

View file

@ -15,21 +15,29 @@ USERCODE = VUserMain0.cpp \
fpgaCfg5Test.cpp \
shtdnMon0Test.cpp
ELGIPDIR = ..\..\..\el_generic_ip\generic_ip
SYNTHDIRNAME = build_fc5_c7
# Get the OS type
OSTYPE:=$(shell uname)
# Set the OS specific variable between Linux and Windows (MinGW)
ifeq (${OSTYPE}, Linux)
MODELSIMDIR = /opt/altera_18_1_linux/ver/modelsim_ae
MODELSIMDIRAUX = /opt/altera_18_1_linux/ver/modelsim_ase
MAKE_EXE = make
VSIMEXE = ${MODELSIMDIR}/linuxaloem/vsim
VSIMEXEAUX = ${MODELSIMDIRAUX}/linuxaloem/vsim
VSIMARGS = -cpppath /usr/bin
AUTOSCRIPT = autobuild.sh
CMDSHELL = bash
else
MODELSIMDIR = c:\altera\ver\modelsim_ae
MODELSIMDIRAUX = c:\altera\ver\modelsim_ase
MAKE_EXE = mingw32-make
VSIMEXE = ${MODELSIMDIR}\\win32aloem\\vsim
VSIMEXEAUX = ${MODELSIMDIRAUX}\\win32aloem\\vsim
VSIMARGS =
AUTOSCRIPT = autobuild.bat
CMDSHELL = cmd /c
@ -38,12 +46,15 @@ endif
FWDEVTOOLS = ../../../../../fw_development_tools
VPROCDIR = ${FWDEVTOOLS}/verification/vproc
# Define where the HAL directory is for the auto-generated code
HALDIR = src/hal
# Pick single target files for two auto-generations---UUT and test.
# The core.h file is always presentfor the UUT, and the test package
# for the test bench
AUTOTGTFILE = ${HALDIR}/core.h
TBAUTOFILE = test_pkg_auto.vhd
ELGIPDIR = ../../../generic_ip/
LIBDOCDIR = ${FWDEVTOOLS}/verification/lib/hdl/doc
# Files used in auto-generating core file lists for simulation.
# compile.do uses the generated Tcl files.
@ -51,23 +62,14 @@ COREHWTCLFILE = ../core_hw.tcl
COREVHDLTCLFILE = files_core_auto.tcl
COREVLOGTCLFILE = files_core_vlog_auto.tcl
JSONFILES = doc/*.json \
../../../print_ctrl/doc/*.json \
../../../print_streamer/doc/*.json \
../../../print_unit/doc/*.json \
../../../top/doc/core.json \
${LIBDOCDIR}/*.json \
${ELGIPDIR}/shutdown_monitor/0/doc/*.json \
${ELGIPDIR}/enc_pd_emul/1/doc/*.json \
${ELGIPDIR}/fire_pulse_manager/3/doc/*.json \
${ELGIPDIR}/generic_delay_queue/1/doc/*.json \
${ELGIPDIR}/generic_pio/1/doc/*.json \
${ELGIPDIR}/generic_sequencer/15/doc/*.json \
${ELGIPDIR}/hmb_fpga_cfg/5/doc/*.json \
${ELGIPDIR}/pulse_generator/1/doc/*.json \
${ELGIPDIR}/signal_sequencer/10/doc/*.json \
${ELGIPDIR}/swim/2/doc/*.json \
${ELGIPDIR}/uart_1MBd/3/doc/*.json
# Local test JSON file(s)
JSONFILES = doc/*.json
# Name of auto-generated UUT JSON make dependency file
JSONDEPENDFILE = json.d
# JSON dependency make file script generation command
JSONDEPENDCMD = py -3 ${FWDEVTOOLS}/logic_memory_mapper/gen_depend.py
# If no external code directory (e.g. a HAL) set this to local source directory, else set to code directory
EXTINCLDIR = ${CURDIR}/src
@ -81,7 +83,24 @@ HALCOPTS = -DVPROC_VHDL
# Build is dependant on generating the auto-gen file and
# processing makefile in vproc
all: ${TBAUTOFILE} ${COREVHDLTCLFILE} ${COREVLOGTCLFILE} vproc
.PHONY: all
all: ${JSONDEPENDFILE} ${AUTOTGTFILE} ${TBAUTOFILE} ${COREVHDLTCLFILE} ${COREVLOGTCLFILE} vproc
.PHONY: ${JSONDEPENDFILE}
${JSONDEPENDFILE}:
@${JSONDEPENDCMD} -r ../../../.. -d ${SYNTHDIRNAME} -b csr seq -m ${JSONDEPENDFILE}
# If the JSON dependency file exists, read it in.
ifneq (, $(wildcard ${JSONDEPENDFILE}))
include ${JSONDEPENDFILE}
else
$(warning no ${JSONDEPENDFILE} make dependency file found. Regenerating... Please re-run make.")
endif
# Make UUT auto-gen code dependant on all the JSON files to
# call the batch file if any have changed
${AUTOTGTFILE}:
@${CMDSHELL} ${AUTOSCRIPT}
# Make test bench auto-gen code dependant on all the JSON files to
# call the batch file if any have changed
@ -90,10 +109,12 @@ ${TBAUTOFILE}: ${JSONFILES}
# Generate the local list of VHDL core files from the QSYS core tcl file
${COREVHDLTCLFILE}: ${COREHWTCLFILE}
@awk '/VHDL/{print "../" $$5}' $< > $@
@awk '/^#/{next}/VHDL/{print "../" $$5}' $< > $@
# Generate the local list of Verilog core files from the QSYS core tcl file
${COREVLOGTCLFILE}: ${COREHWTCLFILE}
@awk '/VERILOG/{print "../" $$5}' $< > $@
@awk '/^#/{next}/VERILOG/{print "../" $$5}' $< > $@
# Call the vproc make file for it to determine if anything
# needs building.
.PHONY : vproc
@ -109,7 +130,7 @@ vproc:
# EXECUTION RULES
#------------------------------------------------------
# For run, delete the simulation log befoere execution so that on
# For run, delete the simulation log before execution so that on
# jenkins a compilation failure will not get a false positive on
# an old successful log
run: all
@ -126,24 +147,54 @@ runncgui: all
@${VSIMEXE} -gui -do sim_nocomb_gui.do ${VSIMARGS}
runser: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXE} -c -do sim_serdes.do ${VSIMARGS}
runlog: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXE} -c -do simlog.do ${VSIMARGS}
runnclog: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXE} -c -do simnclog.do ${VSIMARGS}
runfree: all
@awk -F" " '/add wave/{print "log " $$NF}' < wave.do > batch.do
@${VSIMEXEAUX} -c -do simlog.do ${VSIMARGS}
compile:
@${VSIMEXE} -c -do compile.do -do quit
waves:
@${VSIMEXEAUX} -view vsim.wlf -do wave.do
autobuild:
@${CMDSHELL} ${AUTOSCRIPT}
synth: ${AUTOTGTFILE}
@${MAKE_EXE} -C ../../${SYNTHDIRNAME}
gui: rungui
sim: run
nc: runnc
nclog: runnclog
log: runlog
free: runfree
#------------------------------------------------------
# CLEANING RULES
#------------------------------------------------------
clean:
ifeq ($(MAKELEVEL), 0)
@${MAKE_EXE} -C ${VPROCDIR} USER_C="${USERCODE}" TESTDIR="${CURDIR}" clean
@${MAKE_EXE} -C ../../${SYNTHDIRNAME} clean
@rm -rf ${JSONDEPENDFILE}
@rm -rf "wlf*"
@rm -rf "work"
@rm -rf *_auto.vhd
@ -152,4 +203,4 @@ clean:
@rm -rf ${COREVLOGTCLFILE}
@rm -rf src/hal/*.h
@vsim -c -do cleanvlib.do -do quit
endif

View file

@ -1,5 +1,8 @@
# Create clean libraries
do cleanvlib.do
foreach lib [list work tb_pkg] {
file delete -force -- $lib
vlib $lib
}
# Compile the code into the appropriate libraries
do compile.do
@ -7,11 +10,16 @@ do compile.do
# Get any command line argumens added to the .do file call
set vsimargs [lrange $argv 3 end]
# Run the tests.
vsim -quiet -pli VProc.so +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 1ns tb -l sim.log
# Run the tests.
vsim -quiet -pli VProc.so +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 1ps tb -l sim.log\
[lindex $vsimargs 0] [lindex $vsimargs 1] [lindex $vsimargs 2] \
[lindex $vsimargs 3] [lindex $vsimargs 4] [lindex $vsimargs 5] \
[lindex $vsimargs 6] [lindex $vsimargs 7] [lindex $vsimargs 8]
set StdArithNoWarnings 1
set NumericStdNoWarnings 1
log * -r
do wave.do
run -all
#Exit the simulations

View file

@ -1,5 +1,8 @@
# Create clean libraries
do cleanvlib.do
foreach lib [list work] {
file delete -force -- $lib
vlib $lib
}
# Compile the code into the appropriate libraries
do compile.do
@ -8,7 +11,10 @@ do compile.do
set vsimargs [lrange $argv 3 end]
# Run the tests
vsim -quiet -pli VProc.so -gGUI_RUN=true +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 100ps -gui tb
vsim -quiet -pli VProc.so -gGUI_RUN=true +nowarnTFMPC -L altera_mf_ver -L altera_mf -t 1ps -gui tb \
[lindex $vsimargs 0] [lindex $vsimargs 1] [lindex $vsimargs 2] \
[lindex $vsimargs 3] [lindex $vsimargs 4] [lindex $vsimargs 5] \
[lindex $vsimargs 6] [lindex $vsimargs 7] [lindex $vsimargs 8]
set StdArithNoWarnings 1
set NumericStdNoWarnings 1

View file

@ -9,8 +9,7 @@
// INCLUDES
// --------------------------------------------------
#include <string.h>
#include <thread>
#include <mutex>
#include <ctime>
#include "VUserMain0.h"
#include "utils.h"
@ -44,8 +43,7 @@ extern "C" {
// STATIC VARIABLES
// --------------------------------------------------
// I'm node 0
static int node = 0;
static uint32_t sysClkPeriodPs = 10000;
static int node = 0;
// --------------------------------------------------
// Hooks for auto-generated HAL
@ -53,40 +51,33 @@ static uint32_t sysClkPeriodPs = 10000;
uint32_t read_ext (uint32_t addr, uint32_t* data)
{
return csrReadMem(addr, data);
return csrReadMem(addr, data);
}
void write_ext (uint32_t addr, uint32_t data)
{
csrWriteMem(addr, data);
csrWriteMem(addr, data);
}
//std::mutex rmtx;
//std::mutex wmtx;
// --------------------------------------------------
// Read function to access memory over CSR bus
// --------------------------------------------------
uint32_t csrReadMem (uint32_t addr, uint32_t* data)
{
uint32_t rdata;
uint32_t rdata;
// unique_lock<mutex> lck (rmtx, defer_lock);
// Read over the AVS bus
VRead(addr, &rdata, NORMAL_UPDATE, node);
// lck.lock();
// Read over the AVS bus
VRead(addr, &rdata, NORMAL_UPDATE, node);
*data = rdata;
*data = rdata;
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
// lck.unlock();
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
#ifdef DEBUG
VPrint("csrReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
VPrint("csrReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
#endif
return 0;
return 0;
}
// --------------------------------------------------
@ -95,45 +86,41 @@ uint32_t csrReadMem (uint32_t addr, uint32_t* data)
void csrWriteMem (uint32_t addr, uint32_t data)
{
#ifdef DEBUG
VPrint("csrWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
VPrint("csrWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
#endif
// unique_lock<mutex> lck (wmtx, std::defer_lock);
// Write over the AVS bus for this node
VWrite(addr, data, NORMAL_UPDATE, node);
// lck.lock();
// Write over the AVS bus for this node
VWrite(addr, data, NORMAL_UPDATE, node);
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
// lck.unlock();
// Model some access rate time
VTick(AVS_ACCESS_LEN, node);
}
// --------------------------------------------------
// Read function to access memory directly (bypass sim)
// --------------------------------------------------
uint32_t directReadMem (uint32_t addr, uint32_t* data, bool little_endian = false)
uint32_t directReadMem (uint32_t addr, uint32_t* data, bool little_endian)
{
uint32_t rdata;
uint32_t rdata;
*data = ReadRamWord(addr, little_endian, node);
*data = ReadRamWord(addr, little_endian, node);
#ifdef DEBUG
VPrint("directReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
VPrint("directReadMem : addr = 0x%08x data = 0x%08x\n", addr, *data); fflush(NULL);
#endif
return 0;
return 0;
}
// --------------------------------------------------
// Write function to access memory directly (bypass sim)
// --------------------------------------------------
void directWriteMem (uint32_t addr, uint32_t data, bool little_endian = false)
void directWriteMem (uint32_t addr, uint32_t data, bool little_endian)
{
#ifdef DEBUG
VPrint("directWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
VPrint("directWriteMem : addr = 0x%08x data = 0x%08x\n", addr, data); fflush(NULL);
#endif
WriteRamWord(addr, data, little_endian, node);
WriteRamWord(addr, data, little_endian, node);
}
// --------------------------------------------------
@ -142,31 +129,31 @@ void directWriteMem (uint32_t addr, uint32_t data, bool little_endian = false)
void stopSim(bool error)
{
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_STOP_MASK |
(error == TEST_ERROR ? TB_SIM_CTRL_ERROR_MASK : 0) |
(error == NOFAILURES ? TB_SIM_CTRL_PARTIAL_TEST_MASK : 0));
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_STOP_MASK |
(error == TEST_ERROR ? TB_SIM_CTRL_ERROR_MASK : 0) |
(error == NOFAILURES ? TB_SIM_CTRL_PARTIAL_TEST_MASK : 0));
}
void finishSim(int error)
{
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_FINISH_MASK |
(error == TEST_ERROR ? TB_SIM_CTRL_ERROR_MASK : 0) |
(error == NOFAILURES ? TB_SIM_CTRL_PARTIAL_TEST_MASK : 0));
csrWriteMem(TB_SIM_CTRL_REG, TB_SIM_CTRL_FINISH_MASK |
(error == TEST_ERROR ? TB_SIM_CTRL_ERROR_MASK : 0) |
(error == NOFAILURES ? TB_SIM_CTRL_PARTIAL_TEST_MASK : 0));
}
void usleepSim(unsigned time)
{
VTick((time * 1000 * 1000)/sysClkPeriodPs, node);
VTick((time * 1000)/SYS_CLK_PERIOD_NS, node);
}
void nsleepSim(unsigned time)
{
uint64_t time64 = time;
uint64_t time64 = time;
// Make ticks a minimum of 1, and do rounding to nearest clock period
uint32_t ticks = ((time64 * 1000) < (sysClkPeriodPs) ? 1 : (time64 * 1000 + sysClkPeriodPs/2)/sysClkPeriodPs);
// Make ticks a minimum of 1, and do rounding to nearest clock period
unsigned ticks = (time < SYS_CLK_PERIOD_NS) ? 1 : ((time + SYS_CLK_PERIOD_NS/2)/SYS_CLK_PERIOD_NS);
VTick(ticks, node);
VTick(ticks, node);
}
// ==================================================
@ -175,91 +162,93 @@ void nsleepSim(unsigned time)
extern "C" void VUserMain0()
{
int error = 0;
int testnum = MAINTESTNUM;
uint32_t zgBpp = 1;
uint32_t tmp1 = 0;
uint32_t tmp2 = 0;
bool pauseForDebug = false;
int error = 0;
int testnum = MAINTESTNUM;
uint32_t zgBpp = 1;
uint32_t tmp1 = 0;
uint32_t tmp2 = 0;
bool pauseForDebug = false;
zgConfig_t zgCfg;
zgConfig_t zgCfg;
CTestAuto* pTestBench = new CTestAuto((uint32_t*)(0));
CTestAuto* pTestBench = new CTestAuto((uint32_t*)(0));
VPrint("\n*****************************\n");
VPrint( "* Global Inkjet Systems *\n");
VPrint( "* Virtual Processor (VProc) *\n");
VPrint( "* Copyright (c) 2019 *\n");
VPrint( "*****************************\n\n");
VPrint("\n*****************************\n");
VPrint( "* Global Inkjet Systems *\n");
VPrint( "* Virtual Processor (VProc) *\n");
VPrint( "* Copyright (c) 2020 *\n");
VPrint( "*****************************\n\n");
VPrint("Entered VUserMain%d()\n\n", node);
VPrint("Entered VUserMain%d()\n\n", node);
uint32_t clkFreqMHz = pTestBench->pConfigClkFreq->GetConfigClkFreq();
sysClkPeriodPs = 1000000/clkFreqMHz;
// Parse arguments. As no argc and argv, pass in these as null, and it will look for
// vusermain.cfg, which should have a single line with the command line options. If this
// file doesn't exist, no parsing is done.
parseArgs(0, nullptr, testnum, pauseForDebug, zgCfg);
// Parse arguments. As no argc and argv, pass in these as null, and it will look for
// vusermain.cfg, which should have a single line with the command line options. If this
// file doesn't exist, no parsing is done.
parseArgs(0, nullptr, testnum, pauseForDebug, zgCfg);
if (pauseForDebug)
{
VPrint("NODE %d: Paused for debug attachment. Press <enter> when ready....\n\n", node);
getc(stdin);
}
if (pauseForDebug)
{
VPrint("NODE %d: Paused for debug attachment. Press <enter> when ready....\n\n", node);
getc(stdin);
}
usleepSim(1);
usleepSim(1);
// Check we're alive by writing to memory over CSR bus
csrWriteMem(MEM_BASE_ADDR + ALIVE_TEST_OFFSET, ALIVE_TEST_NUM);
// Check we're alive by writing to memory over CSR bus
csrWriteMem(MEM_BASE_ADDR + ALIVE_TEST_OFFSET, ALIVE_TEST_NUM);
// Read back over CSR bus
csrReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp1);
// Read back over CSR bus
csrReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp1);
// Read directly from memory model (bypassing simulation)
directReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp2, true);
// Read directly from memory model (bypassing simulation)
directReadMem (MEM_BASE_ADDR + ALIVE_TEST_OFFSET, &tmp2, true);
if (tmp1 != ALIVE_TEST_NUM || tmp2 == ALIVE_TEST_NUM)
{
VPrint("\nVUserMain%d() failed start up memory access check\n\n", node);
error = 1;
}
// If start up check passed, run user test code
else
{
runTest* pTests;
if (tmp1 != ALIVE_TEST_NUM || tmp2 == ALIVE_TEST_NUM)
{
VPrint("\nVUserMain%d() failed start up memory access check\n\n", node);
error = 1;
}
// If start up check passed, run user test code
else
{
runTest* pTests;
// #######################################
// # Call test code here
// #######################################
// #######################################
// # Call test code here
// #######################################
// Run the test code
switch(testnum)
{
case MAINTESTNUM :
{
//pTests = new runTest(runTest::all);
pTests = new runTest(runTest::dataCore);
//pTests = new runTest(runTest::dataCore2Bpp);
//pTests = new runTest(runTest::shutdownMon); // Test 5 and 6 fail. Same in 0.9.6
//pTests = new runTest(runTest::multiHeads);
//pTests = new runTest(runTest::allOnEmul);
error = pTests->start(CORE_BASE_ADDR, zgCfg, node);
break;
}
case ZGIMAGETEST :
{
pTests = new runTest(runTest::zeroGapImage);
error = pTests->start(CORE_BASE_ADDR, zgCfg, node);
break;
}
}
}
// Run the test code
switch(testnum)
{
case MAINTESTNUM :
{
pTests = new runTest(runTest::all);
error = pTests->start(CORE_BASE_ADDR, zgCfg, node);
break;
}
case ZGIMAGETEST :
{
pTests = new runTest(runTest::zeroGapImage);
error = pTests->start(CORE_BASE_ADDR, zgCfg, node);
break;
}
}
}
// Wait a bit
usleepSim(1);
// Wait a bit
usleepSim(1);
// Tell the simulator to finish
VPrint("\nVUserMain%d() finishing with status %d\n\n", node, error);
finishSim(error);
// Tell the simulator to finish
VPrint("\nVUserMain%d() finishing with status %d\n\n", node, error);
finishSim(error);
// Sleep for ever, ticking. Don't exit or loop forever internally
// (e.g. while (1);) as simulation will hang.
SLEEP_FOREVER;
// Sleep for ever, ticking. Don't exit or loop forever internally
// (e.g. while (1);) as simulation will hang.
SLEEP_FOREVER;
}

View file

@ -5,6 +5,10 @@
/* */
/**************************************************************/
#ifndef _VUSERMAIN_H_
#define _VUSERMAIN_H_
extern "C" {
#include "VUser.h"
}
@ -39,3 +43,4 @@ void directWriteMem (uint32_t addr, uint32_t data, bool little_endian);
extern "C" uint32_t read_ext (uint32_t addr, uint32_t* data);
extern "C" void write_ext (uint32_t addr, uint32_t data);
#endif

View file

@ -16,11 +16,11 @@
#include "bmpUtils.h"
#include "runTestLocal.h"
using namespace std;
#define TEST_ERROR 1
#define NOERROR 0
using namespace std;
#ifdef HDL_SIM
#include "VUserMain0.h"
@ -261,6 +261,7 @@ int bmpUtils::readBmp(uint32_t** buf, const char * fname, bool invert, uint32_t
if (inFile == nullptr)
{
VPrint("readBmp(): File open error\n");
return TEST_ERROR;
}
@ -350,6 +351,72 @@ int bmpUtils::readBmp(uint32_t** buf, const char * fname, bool invert, uint32_t
return NOERROR;
}
// --------------------------------------------------
// Read in raw 4bpp data and convert to 1
// --------------------------------------------------
int bmpUtils::readRaw (uint32_t** buf, const char *fname, bool invert, bool reverse, uint32_t imgWidth, uint32_t &imgHeight)
{
FILE *inFile = fopen(fname, "rb");
if (inFile == nullptr)
{
VPrint("readRaw(): File open error\n");
return TEST_ERROR;
}
// Get the file size (bytes)
fseek(inFile, 0, SEEK_END);
uint32_t filelen = (uint32_t)ftell(inFile);
rewind(inFile);
imgHeight = filelen*8/imgWidth;
uint32_t numWordsForImage = (32*((imgWidth+31)/32)*imgHeight)/32;
*buf = new uint32_t[numWordsForImage];
//VPrint("readRaw: filelen = %d h=%d w=%d\n", filelen, imgHeight, imgWidth);
int invertMask = invert ? 0xff : 0x00;
// Reset the word accumulator
uint32_t word = 0;
// Scan through each word in the image
for (unsigned idx = 0; idx < (32*((imgWidth+31)/32)*imgHeight)/32; idx++)
{
// Scan through each byte in the word
for (unsigned jdx = 0; jdx < 32; jdx += 8)
{
// Fetch the byte from the file
int byte0 = fgetc(inFile) ^ invertMask;
if (byte0 == EOF)
{
VPrint("readRaw(): Unexpected EOF reading image data. (w=%d h=%d idx=%d jdx=%d)\n", imgWidth, imgHeight, idx, jdx);
return TEST_ERROR;
}
if (reverse)
{
word |= (unsigned)(bitRev8(byte0)) << jdx;
}
else
{
word |= (unsigned)(byte0) << jdx;
}
}
// Put the constructed word in the buffer
(*buf)[idx] = word;
// Reset the accumulator word.
word = 0;
}
return 0;
}
// --------------------------------------------------
// Eight bit reverse utility method

View file

@ -43,6 +43,7 @@ protected:
int dumpMemBmp (uint32_t addr, unsigned wordlen, const char * fname, int node);
int dumpMemBmp (uint32_t* buf, unsigned widthPx, unsigned heightPx, const char * fname, int node);
int readBmp (uint32_t** buf, const char * fname, bool invert, uint32_t &imgWidth, uint32_t &imgHeight, uint32_t bpp = 1);
int readRaw (uint32_t** buf, const char * fname, bool invert, bool reverse, uint32_t imgWidth, uint32_t &imgHeight);
private:
uint8_t bitRev8 (uint8_t byte);

View file

@ -1,206 +0,0 @@
/**************************************************************/
/* runTest.h Date: 2018/08/9 */
/* */
/* Copyright (c) 2018 GIS. All rights reserved. */
/* */
/**************************************************************/
#include <stdio.h>
#include <stdlib.h>
#include "VUserMain0.h"
#include "hal/CCoreAuto.h"
#ifndef _FPMUTILS_H_
#define _FPMUTILS_H_
// VProc user API has C linkage
#ifdef HDL_SIM
extern "C" {
#include "VUser.h"
}
#endif
// Include top level HAL header
#include "hal/CCoreAuto.h"
class fpmUtils
{
public:
static const uint32_t FPM_ZG_PATTERN[];
static const uint32_t FPM_ZG_LEN = 7;
static const uint32_t FPM_ZG_SEQ_SIZE_POS1 = 4;
static const uint32_t FPM_ZG_SEQ_SIZE_POS2 = 5;
static const uint32_t FPM_ZG_SEQ_SIZE_OFFSET = 8;
static const uint32_t FPM_ZG_SEQ_SIZE_MASK = 0xfffff;
static const uint32_t REG_WR_LATENCY_NS = 60;
static const uint32_t STARTUP_LATENCY_NS = 18000;
const double DIV_RATIO = 1.0;
// Constructor
fpmUtils() {};
protected:
void configFpmForEmulPulses(CCoreAuto* pCore, uint32_t numStripes, double encFreqKHz, double clkFreqMHz)
{
fpmZeroGapConfig(pCore, numStripes);
configPdEmulator(pCore, encFreqKHz, clkFreqMHz);
};
// ------------------------------------
// Configure the FPM's pulse generator
//
int fpmZeroGapConfig(CCoreAuto* pCore, uint32_t numStripes)
{
CPulseGenerator2Auto* pPulseGen = pCore->pPulseGenerator20;
// Load the sequencer with default program
uint32_t seqBaseAddr = (uint32_t)pPulseGen->GetCsrBaseAddr() + CSR_PULSE_GENERATOR_2_CHANNEL_CONTROLLER_SEQ;
for(int idx = 0; idx < FPM_ZG_LEN; idx++)
{
uint32_t seqWord = FPM_ZG_PATTERN[idx];
// Update the sequence with the image stripe count for the test
if (idx == FPM_ZG_SEQ_SIZE_POS1 || idx == FPM_ZG_SEQ_SIZE_POS2)
{
seqWord = (seqWord & ~(FPM_ZG_SEQ_SIZE_MASK << FPM_ZG_SEQ_SIZE_OFFSET)) |
((numStripes & FPM_ZG_SEQ_SIZE_MASK) << FPM_ZG_SEQ_SIZE_OFFSET);
}
csrWriteMem(seqBaseAddr + idx*4, seqWord);
}
// Disable/Re-enable first the whole pulse_generator
pPulseGen->pPulseGenControl->SetPulseGenControl(0);
pPulseGen->pPulseGenControl->SetEnable(1);
pPulseGen->pPulseGenControl->SetEnableOutput(1);
// Disable the Channel Controller sequencer
pPulseGen->pChannelControllerControl->SetChannelControllerControl(0);
// --- set_div_ratio
// set the sub-pixel offset
pPulseGen->pSubpixelOffsetInt->SetSubpixelOffsetInt(0);
pPulseGen->pSubpixelOffsetFraction->SetSubpixelOffsetFraction(0);
// Set the integer part of the div-ratio
uint64_t ratio_int = (DIV_RATIO * (double)(1UL << 24));
pPulseGen->pDividerRatioInt->SetDividerRatioInt((uint32_t)(ratio_int >> 24));
// Set the fractional part of the div-ratio
pPulseGen->pDividerRatioFraction->SetDividerRatioFraction((uint32_t)(ratio_int & ((1UL << 24)-1)));
// ----
// Disable/Enable the fractional divider
pPulseGen->pFractionalDividerControl->SetFractionalDividerControl(0);
pPulseGen->pFractionalDividerControl->SetFractionalDividerControl(CSR_PULSE_GENERATOR_2_FRACTIONAL_DIVIDER_CONTROL_ENABLE_MASK |
CSR_PULSE_GENERATOR_2_FRACTIONAL_DIVIDER_CONTROL_UDP_MAX_POS_MASK |
CSR_PULSE_GENERATOR_2_FRACTIONAL_DIVIDER_CONTROL_UDP_MIN_POS_MASK);
// enable the ch-ctrl sequencer
pPulseGen->pGenericSequencer15Channel->pCtrl->SetSeqEnable(1);
// Issue a start_req to the ch-ctrl sequencer
pPulseGen->pChannelControllerControl->SetChannelControllerControl(1);
// Enable pulse generator
pPulseGen->pPulseGenControl->SetEnableOutput(1);
pPulseGen->pPulseGenControl->SetEnable(1);
};
// ------------------------------------
// Issue a product detect
//
inline void issuePd (CEncPdEmul1Auto* pEmul, bool setEnables = false)
{
if (setEnables)
{
// Enable everything
pEmul->pOutEnable->SetOutEnable(0xff);
}
pEmul->pPdCtrl->SetPdCtrl(CSR_ENC_PD_EMUL_1_PD_CTRL_PD_EN_MASK | CSR_ENC_PD_EMUL_1_PD_CTRL_PD_GEN_MASK);
};
// ------------------------------------
// Configure the product detect emulator
//
void configPdEmulator(CCoreAuto* pCore, double encFreqKHz, double clkFreqMHz)
{
pCore->pEncPdEmul1->pEncCtrl->SetSetAbsPos(1);
// Select source of pulses
pCore->pFpmCtrl4->pSignalselection->SetSignalselection(1);
pCore->pFpmCtrl4->pSignalselection->SetEncPdEmulEn(1);
// Run the encoder
runEnc(pCore->pEncPdEmul1, encFreqKHz/1000.0, 1, 1, clkFreqMHz);
};
// ------------------------------------
// Generate a set of product detects
// spaced at a given period
//
void generatePDs(CCoreAuto* pCore, uint32_t numPDs, uint32_t periodNs)
{
for (int idx = 0; idx < numPDs; idx++)
{
issuePd(pCore->pEncPdEmul1);
if (idx == 0)
{
nsleepSim(periodNs - REG_WR_LATENCY_NS + STARTUP_LATENCY_NS);
}
else
{
nsleepSim(periodNs - REG_WR_LATENCY_NS);
}
}
};
private:
// ------------------------------------
// convert a frequency into a NCO inc
//
inline uint32_t freq2NCO(double freqMHz, double clkFreqMHz)
{
// The NCO is 32 bits wide
return (uint32_t)(((freqMHz/4)/clkFreqMHz)*((double)(1 << 16)*(double)(1 << 16)));
}
// ------------------------------------
// Configure and run the PD emulator
//
void runEnc(CEncPdEmul1Auto* pEmul, double freqMHz, int enable, int init_phase_en, double clkFreqMHz)
{
// Make sure all the outputs are enabled
pEmul->pOutEnable->SetOutEnable(0xff);
// Set the NCO frequency
pEmul->pEncNcoInc->SetEncNcoInc(freq2NCO(freqMHz, clkFreqMHz));
// Re-initialise the NCO phase (Phase-1 and Phase-2 both to zero)
if(init_phase_en)
{
pEmul->pEncCtrl->SetNcoInit(1);
}
if(enable)
{
pEmul->pEncCtrl->SetNcoEn(1);
}
};
};
#endif

File diff suppressed because it is too large Load diff

View file

@ -32,175 +32,176 @@ class runTest : public swim2Tests, fpgaCfg5Test, shtdnMon0Test, zeroGapTests
{
public:
// Burst bus bits -- 7:0 GL remap value, 8 GL update bit, 18:9 start req delay, 19 start request pulse, 20 fetch pixels/first pulse, 21 last pulse, 23:22 bpp, 24 bpp_update
// Vector bus bits -- 9:0 Wave seq start delay, 17:10 wave seq start addr, 18 wave seq start bit
static const uint32_t PSEQ_PATTERN0[];
static const uint32_t PSEQ_PATTERN1[];
// Burst bus bits -- 7:0 GL remap value, 8 GL update bit, 18:9 start req delay, 19 start request pulse, 20 fetch pixels/first pulse, 21 last pulse, 23:22 bpp, 24 bpp_update
// Vector bus bits -- 9:0 Wave seq start delay, 17:10 wave seq start addr, 18 wave seq start bit
static const uint32_t PSEQ_PATTERN0[];
static const uint32_t PSEQ_PATTERN1[];
// Burst bus bits -- Unused on wave sequencer
// Vector bus bits -- 13:0 DAC data, 14 STM8 trigger, 15 print_latch, 16 print_all_on
// NB: the minimum time between waveform pulses (i.e. the time between print_latch
// assertions must be 260 cycles (at 100MHz clock) in order to avoid re-asserting
// the latch signal before data has finished transferring.
static const uint32_t WSEQ_PATTERN0[];
static const uint32_t WSEQ_PATTERN1[];
static const uint32_t SEQ_PATTERN0[];
// Burst bus bits -- Unused on wave sequencer
// Vector bus bits -- 13:0 DAC data, 14 STM8 trigger, 15 print_latch, 16 print_all_on
// NB: the minimum time between waveform pulses (i.e. the time between print_latch
// assertions must be 260 cycles (at 100MHz clock) in order to avoid re-asserting
// the latch signal before data has finished transferring.
static const uint32_t WSEQ_PATTERN0[];
static const uint32_t WSEQ_PATTERN1[];
static const uint32_t SEQ_PATTERN0[];
static const uint32_t STRIPE_1BPP0[];
static const uint32_t STRIPE_3BPP[];
static const uint32_t STRIPE_1BPP0[];
static const uint32_t STRIPE_3BPP[];
static const uint32_t AVS_TEST_VALS[];
static const uint32_t AVS_TEST_VALS[];
static const uint32_t WSEQ_PATTERN0_SIG = 56183060;
static const uint32_t WSEQ_PATTERN0_SIG_NC = 56317272;
static const uint32_t WAV_DAC_0V_VALUE = 178;
static const uint32_t WSEQ_PATTERN0_SIG = 56183060;
static const uint32_t WSEQ_PATTERN0_SIG_NC = 56317272;
static const uint32_t WAV_DAC_0V_VALUE = 178;
static const uint32_t SEQ_ADDR_OFFSET = 0x000F0000;
static const uint32_t SEQ_ADDR_OFFSET = 0x000F0000;
static const int numSg600Uarts = 3;
static const int numSg600Uarts = 3;
// Offsets for the waveform sequencer vector output
enum waveVectorOffsets_e {
dacDataOffset = 0,
stm8TrigOffset = 14,
printLatchOffset = 15,
printAllOnOffset = 16,
resetTickOffset = 17
};
// Offsets for the waveform sequencer vector output
enum waveVectorOffsets_e {
dacDataOffset = 0,
stm8TrigOffset = 14,
printLatchOffset = 15,
printAllOnOffset = 16,
resetTickOffset = 17
};
// Offsets for the print sequencer vector output
enum printBurstBusOffsets_e {
glRemapOffset = 0,
glUpdateOffset = 8,
startReqDlyOffset = 9,
startReqPulseOffset = 19,
firstPulseOffset = 20,
lastPulseOffset = 21,
bppOffset = 22,
bppUpdateOffset = 24
};
// Offsets for the print sequencer vector output
enum printBurstBusOffsets_e {
glRemapOffset = 0,
glUpdateOffset = 8,
startReqDlyOffset = 9,
startReqPulseOffset = 19,
firstPulseOffset = 20,
lastPulseOffset = 21,
bppOffset = 22,
bppUpdateOffset = 24
};
enum printVectorOffsets_e {
waveStartDlyOffset = 0,
waveStartAddrOffset = 10,
waveStartPulseOffset = 18
};
enum printVectorOffsets_e {
waveStartDlyOffset = 0,
waveStartAddrOffset = 10,
waveStartPulseOffset = 18
};
enum testEnable_e {
swimEntry = 0x00000001,
swimTxRx = 0x00000002,
waveSeq = 0x00000004,
avalonBus = 0x00000008,
fpgaCfg = 0x00000010,
uart = 0x00000020,
dataCore = 0x00000040,
printStreamer = 0x00000080,
allOnEmul = 0x00000100,
dataCore2Bpp = 0x00000200,
dataCore3Bpp = 0x00000400,
shutdownMon = 0x00000800,
multiHeads = 0x00001000,
zeroGap = 0x00002000,
enum testEnable_e {
swimEntry = 0x00000001,
swimTxRx = 0x00000002,
waveSeq = 0x00000004,
avalonBus = 0x00000008,
fpgaCfg = 0x00000010,
uart = 0x00000020,
dataCore = 0x00000040,
printStreamer = 0x00000080,
allOnEmul = 0x00000100,
dataCore2Bpp = 0x00000200,
dataCore3Bpp = 0x00000400,
shutdownMon = 0x00000800,
multiHeads = 0x00001000,
zeroGap = 0x00002000,
pwm = 0x00004000,
all = 0x00007fff,
zeroGapImage = 0x10000000
};
all = 0x00007fff,
zeroGapImage = 0x10000000
};
union enables_t
{
testEnable_e e;
unsigned i;
};
union enables_t
{
testEnable_e e;
unsigned i;
};
// Constructor
runTest() : fpgaCfg5Test(0, MEM_BASE_ADDR)
{
// Constructor
runTest() : fpgaCfg5Test(0, MEM_BASE_ADDR)
{
enable.i = all;
shiftDepth = 0;
maxOpWidth = 0;
trim_ps = false;
numHeads = 0;
clkFreqMHz = 100;
dynamicCombine = true;
};
enable.i = all;
shiftDepth = 0;
maxOpWidth = 0;
trim_ps = false;
numHeads = 0;
clkFreqMHz = 100;
dynamicCombine = true;
};
// Constructor
runTest(unsigned tests) : fpgaCfg5Test(0, MEM_BASE_ADDR)
{
enable.i = tests;
shiftDepth = 0;
maxOpWidth = 0;
trim_ps = false;
numHeads = 0;
clkFreqMHz = 100;
dynamicCombine = true;
};
// Constructor
runTest(unsigned tests) : fpgaCfg5Test(0, MEM_BASE_ADDR)
{
enable.i = tests;
shiftDepth = 0;
maxOpWidth = 0;
trim_ps = false;
numHeads = 0;
clkFreqMHz = 100;
dynamicCombine = true;
};
// Entry method for running the tests
int start (uint32_t* coreBaseAddr, zgConfig_t &zgCfg, int node);
// Entry method for running the tests
int start (uint32_t* coreBaseAddr, zgConfig_t &zgCfg, int node);
private:
// Quick sanity check to verify basic comms ability.
int sanityTest (CCoreAuto* pCore, int node = 0);
// Quick sanity check to verify basic comms ability.
int sanityTest (CCoreAuto* pCore, int node = 0);
// Project specific test methods
int wave_seq_test (CCoreAuto* pCore, int node = 0, int testGroup = waveSeqTestGroup);
int data_core_test (CCoreAuto* pCore, int node = 0, int testGroup = dataCoreTestGroup);
int print_streamer_test (CCoreAuto* pCore, int node = 0, int testGroup = printStreamerTestGroup);
int all_on_emul_test (CCoreAuto* pCore, int node = 0, int testGroup = allOnEmulTestGroup);
int data_core_multi_bpp_test (CCoreAuto* pCore, uint32_t bpp, int node = 0, int testGroup = dataCoreMultiTestGroup);
int multi_heads_test (CCoreAuto* pCore, int node = 0, int testGroup = multiHeadsTestGroup);
int avalon_bus_test (CCoreAuto* pCore, int node = 0, int testGroup = avalonBusTestGroup);
int pwm_test (CCoreAuto* pCore, int node);
int common_data_setup (CCoreAuto* pCore, bool checkSeq, unsigned patternNum, int node = 0, int testGroup = commonDataTestGroup);
// Project specific test methods
int wave_seq_test (CCoreAuto* pCore, int node = 0, int testGroup = waveSeqTestGroup);
int data_core_test (CCoreAuto* pCore, int node = 0, int testGroup = dataCoreTestGroup);
int print_streamer_test (CCoreAuto* pCore, int node = 0, int testGroup = printStreamerTestGroup);
int all_on_emul_test (CCoreAuto* pCore, int node = 0, int testGroup = allOnEmulTestGroup);
int data_core_multi_bpp_test (CCoreAuto* pCore, uint32_t bpp, int node = 0, int testGroup = dataCoreMultiTestGroup);
int multi_heads_test (CCoreAuto* pCore, int node = 0, int testGroup = multiHeadsTestGroup);
int avalon_bus_test (CCoreAuto* pCore, int node = 0);
int pwm_test (CCoreAuto* pCore, int node);
int common_data_setup (CCoreAuto* pCore, bool checkSeq, unsigned patternNum, int node = 0, int testGroup = commonDataTestGroup);
inline uint32_t constructWaveVector(
const uint32_t dacVal,
const bool stm8Trig,
const bool latch,
const bool allOn,
const bool resetTick
)
{
return ((dacVal & 0x3fff) << dacDataOffset) |
((stm8Trig ? 1 : 0) << stm8TrigOffset) |
((latch ? 1 : 0) << printLatchOffset) |
((allOn ? 1 : 0) << printAllOnOffset) |
((resetTick ? 1 : 0) << resetTickOffset);
}
inline uint32_t constructWaveVector(
const uint32_t dacVal,
const bool stm8Trig,
const bool latch,
const bool allOn,
const bool resetTick
)
{
return ((dacVal & 0x3fff) << dacDataOffset) |
((stm8Trig ? 1 : 0) << stm8TrigOffset) |
((latch ? 1 : 0) << printLatchOffset) |
((allOn ? 1 : 0) << printAllOnOffset) |
((resetTick ? 1 : 0) << resetTickOffset);
}
inline uint32_t constructPrintBusBurst(
const uint32_t glRemap,
const bool glRemapUpdate,
const uint32_t startReqDly,
const bool startReqPulse,
const bool firstPulse,
const bool lastPulse,
const uint32_t bpp,
const bool bppUpdate
)
{
return ((glRemap & 0xff) << glRemapOffset) |
((glRemapUpdate ? 1 : 0) << glUpdateOffset) |
((startReqDly & 0x3ff) << startReqDlyOffset) |
((startReqPulse ? 1 : 0) << startReqPulseOffset) |
((firstPulse ? 1 : 0) << firstPulseOffset) |
((lastPulse ? 1 : 0) << lastPulseOffset) |
((bpp & 0x3) << bppOffset) |
((bppUpdate ? 1: 0) << bppUpdateOffset);
inline uint32_t constructPrintBusBurst(
const uint32_t glRemap,
const bool glRemapUpdate,
const uint32_t startReqDly,
const bool startReqPulse,
const bool firstPulse,
const bool lastPulse,
const uint32_t bpp,
const bool bppUpdate
)
{
return ((glRemap & 0xff) << glRemapOffset) |
((glRemapUpdate ? 1 : 0) << glUpdateOffset) |
((startReqDly & 0x3ff) << startReqDlyOffset) |
((startReqPulse ? 1 : 0) << startReqPulseOffset) |
((firstPulse ? 1 : 0) << firstPulseOffset) |
((lastPulse ? 1 : 0) << lastPulseOffset) |
((bpp & 0x3) << bppOffset) |
((bppUpdate ? 1: 0) << bppUpdateOffset);
};
};
enables_t enable;
uint32_t maxOpWidth;
uint32_t shiftDepth;
bool trim_ps;
bool dynamicCombine;
uint32_t numHeads;
uint32_t clkFreqMHz;
enables_t enable;
uint32_t maxOpWidth;
uint32_t shiftDepth;
bool trim_ps;
bool dynamicCombine;
uint32_t numHeads;
uint32_t clkFreqMHz;
bool inlineMerge;
};
#endif

View file

@ -20,15 +20,17 @@
#define TEST_ADDR2 (MEM_BASE_ADDR + 0x0000050c)
#define TEST_ADDR3 (MEM_BASE_ADDR + 0x0000dea8)
#define EXPECTED_PC_ID 0x0000040b
#define EXPECTED_PC_VER 0x00000005
#define EXPECTED_CORE_ID 0x00000418
#define EXPECTED_CORE_VER 0x00000100
typedef struct zgConfig_struct {
char* imgName;
char* invImgName;
char* goldenImgName;
uint32_t numImages;
uint32_t overlapPx;
uint32_t bpp;
bool droppy;
bool serialise;
uint32_t clkFreqMHz;
uint32_t maxOpWidth;

View file

@ -29,6 +29,9 @@
#define TEST_ERROR 1
#define NOERROR 0
// This must match the test bench system clock period to get accurate sleep times in the software
#define SYS_CLK_PERIOD_NS 10
// Define the test groups (the error number bases) for the tests
enum testGroups_e {
swimEntryTestGroup = 0,

View file

@ -16,6 +16,17 @@ extern "C" {
#include "mem_model.h"
}
//const uint32_t fpmUtils::FPM_ZG_PATTERN [] = {
//0x30000000, // VEC_SET now 0
//0x1000000F, // Trigger mask F
//0x30000000, // VEC_SET now 0
//0x20000001, // Trig wait 1
//0x3002e794, // Vec set 0x2e794
//0x3002e700, // Vec set 0x2e700
//0xC0000003
//};
// --------------------------------------------------
// Zero gap tests
// --------------------------------------------------

View file

@ -10,10 +10,10 @@
#ifdef HDL_SIM
#include "VUserMain0.h"
#include "streamerUtils.h"
#include "bmpUtils.h"
#include "serdes.h"
#include "fpmUtils.h"
#include "dataStreamer7Utils.h"
#include "fpm7Utils.h"
#include "runTestLocal.h"
// Memory model API has C linkage functions
@ -28,7 +28,7 @@ extern "C" {
#include "hal/CCoreAuto.h"
class zeroGapTests : public streamerUtils, bmpUtils, serdes, fpmUtils
class zeroGapTests : public dataStreamer7Utils, bmpUtils, serdes, public fpm7Utils
{
public:

View file

@ -1,19 +1,23 @@
-------------------------------------------------------------------------------
-- Title : Core directed test bench top level
-- Project : SG600
-- Project : SG1024
-------------------------------------------------------------------------------
-- File : tb.vhd
-- Author : Simon Southwell
-- Author : Dave Steele
-- Company : Global Inkjet Systems
-- Created : 2018-1-10
-- Created : 2024-1-29
-- Platform :
-- Standard : VHDL 2008
-------------------------------------------------------------------------------
-- Description:
-- This block is the top level test bench for the SG600 core logic
-- This block is the top level test bench for the SG1024 core logic
-------------------------------------------------------------------------------
-- Copyright (c) 2018, 2019 Global Inkjet Systems
-------------------------------------------------------------------------------
-- altera vhdl_input_version vhdl_2008
library modelsim_lib;
use modelsim_lib.util.all;
library ieee;
use ieee.std_logic_1164.all;
@ -23,6 +27,7 @@ library std;
use std.env.all;
use work.top_pkg.all;
use work.sg1024_pkg.all;
use work.print_data_rx_pkg.all;
entity tb is
@ -37,8 +42,8 @@ entity tb is
SHIFT_DEPTH : integer range 1 to 1024 := 128; -- Depth of head shift registers
PCLK_CLK_RATIO : integer range 1 to 32 := 8; -- System clock to PCLK ratio
GUI_RUN : boolean := false; -- Run in GUI mode
NO_ZERO_GAP : boolean := false; -- Enable instantiation of inline merge zero gap logic
ONLY_1BPP : boolean := false; -- Only 1 BPP supported in UUT
TRIM_PS : boolean := true; -- UUT has trimmed data streamer (changes print streamer tests)
VPROC_WR_LENGTH : integer range 1 to 16 := 1; -- Fixed VProc wait states for writes
VPROC_RD_LENGTH : integer range 1 to 16 := 4; -- Fixed VProc wait states for reads
EN_SERDES : boolean := false -- When true, TX SERDES in core enabled along with RX receiver in TB. NB timescale must be 1ps to work.
@ -125,10 +130,17 @@ architecture sim of tb is
signal axm_rvalid : std_logic;
-- Avalon Master write interface to memory model
signal avm_tx_waitrequest : std_logic;
signal avm_tx_burstcount : std_logic_vector (11 downto 0);
signal avm_tx_address : std_logic_vector (31 downto 0);
signal avm_tx_write : std_logic := '0';
signal avm_tx_writedata : std_logic_vector (63 downto 0);
-- Memory model AXM bus control signalling
signal master_reg_access : std_logic;
signal csr_read_uut : std_logic;
signal csr_address : std_logic_vector(15 downto 0);
signal master_reg_access : std_logic;
signal csr_read_uut : std_logic;
signal csr_address : std_logic_vector(15 downto 0);
signal master_reg_pending : std_logic_vector(VPROC_RD_LENGTH - 1 downto 0);
signal master_reg_ack : std_logic;
@ -147,7 +159,7 @@ architecture sim of tb is
signal count_vec : std_logic_vector(31 downto 0);
-- Configuration signals
signal is_trim_ps : std_logic;
signal is_no_zero_gap : std_logic;
signal is_dynamic_combine : std_logic;
-- SWIM signals
@ -215,14 +227,18 @@ architecture sim of tb is
signal mem_port_data : print_data_rx_t(MAX_HEADS - 1 downto 0)(31 downto 0);
signal mem_port_waddr : print_data_rx_t(MAX_HEADS - 1 downto 0)(31 downto 0);
signal fire_req : std_logic_vector(MAX_HEADS - 1 downto 0);
signal start_of_image : std_logic_vector(MAX_HEADS - 1 downto 0);
signal scratch : std_logic_vector(31 downto 0);
signal fire_req : fpm_vec_t(0 to NUM_HEADS - 1);
signal start_of_image : std_logic_vector(MAX_HEADS - 1 downto 0);
signal fire_req_count : std_logic_vector(31 downto 0);
signal start_of_image_count : std_logic_vector(31 downto 0);
signal combine_chans_int : std_logic;
signal swim_out_logic : std_logic_vector(4 downto 0);
signal hmb_dout : std_logic_vector(87 downto 0);
begin
-----------------------------------------
@ -325,11 +341,13 @@ begin
config_max_op_width => std_logic_vector(to_unsigned(MAX_OP_WIDTH, 10)),
config_shift_depth => std_logic_vector(to_unsigned(SHIFT_DEPTH, 10)),
config_trim_ps => is_trim_ps,
config_no_zero_gap => is_no_zero_gap,
config_trim_ps => '0',
config_dynamic_combine => is_dynamic_combine,
config_num_heads => std_logic_vector(to_unsigned(NUM_HEADS, 4)),
config_clk_freq => std_logic_vector(to_unsigned(CLK_FREQ_MHZ, 9)),
scratch => scratch,
uart_tx_status => uart_tx_active,
time_count => count_vec,
timeout => timeout,
@ -392,7 +410,8 @@ begin
constant_latency_if_inst : entity work.constant_latency_if
generic map(
READ_WAIT => 4,
WRITE_WAIT => 1
WRITE_WAIT => 1,
ADDR_WIDTH => 16
)
port map(
reset_n => rst_n,
@ -458,6 +477,23 @@ begin
);
-- memory model port for debug dma writes
dbg_mem_model_inst : entity work.mem_model
generic map (
AVM_TX_WR_DATA_WIDTH => 64
)
port map (
clk => clk,
rst_n => rst_n,
avm_tx_waitrequest => avm_tx_waitrequest,
avm_tx_burstcount => avm_tx_burstcount,
avm_tx_address => avm_tx_address,
avm_tx_write => avm_tx_write,
avm_tx_writedata => avm_tx_writedata
);
-----------------------------------------
-- Test bench glue logic
-----------------------------------------
@ -487,12 +523,12 @@ begin
end process;
GEN_IS_TRIP_PS : if TRIM_PS generate
is_trim_ps <= '1';
GEN_NO_ZERO_GAP: if NO_ZERO_GAP generate
is_no_zero_gap <= '1';
end generate;
GEN_IS_NOT_TRIMP_PS : if not TRIM_PS generate
is_trim_ps <= '0';
GEN_ZERO_GAP : if not NO_ZERO_GAP generate
is_no_zero_gap <= '0';
end generate;
GEN_NO_COMB : if not DYNAMIC_COMBINE generate
@ -503,7 +539,7 @@ begin
is_dynamic_combine <= '1';
end generate;
fire_req <= << signal .tb.core_inst.fire_req : std_logic_vector(MAX_HEADS - 1 downto 0) >>;
fire_req <= << signal .tb.core_inst.fire_req : fpm_vec_t(0 to NUM_HEADS - 1) >>;
--start_of_image <= << signal .tb.core_inst.start_of_image : std_logic_vector(MAX_HEADS-1 downto 0) >>;
start_of_image <= (others => '0'); -- tie off until this feature implemented
@ -521,7 +557,7 @@ begin
start_of_image_count <= (others => '0');
fire_req_count <= (others => '0');
elsif fire_req /= "0000" then
elsif fire_req(0)(0) /= '0' or fire_req(0)(1) /= '0' or fire_req(0)(2) /= '0' or fire_req(0)(3) /= '0' then
fire_req_count <= std_logic_vector(unsigned(fire_req_count) + 1);
@ -675,7 +711,7 @@ begin
rx_outclock => rx_outclock
);
GEN_SERDES_OP_LOOP : for i in 0 to NUM_HEADS generate
GEN_SERDES_OP_LOOP : for i in 0 to NUM_HEADS-1 generate
-- When SERDES models instantiated (slow), get the print signals from the deserializer
-- Note: the foward (side B) demapping. In this mode simulation timescale must be 1ps.
print_all_on(i) <= rx_out(i * 21 + 0);
@ -685,6 +721,39 @@ begin
rx_out(i * 21 + 7) & rx_out(i * 21 + 6) & rx_out(i * 21 + 5) & rx_out(i * 21 + 4) & rx_out(i * 21 + 3) & rx_out(i * 21 + 2);
end generate GEN_SERDES_OP_LOOP;
hmb_fpga_inst : entity work.hmb_fpga_top
generic map (
TEST_MODE => true,
TEST_LVDS => true
)
port map (
lvds_clk_in => lvds_tx_ser(16),
lvds_d_in => lvds_tx_ser(15 downto 0),
d_out => hmb_dout,
clk25_in => clk,
amp_trip_temp => (others => '0'),
led_out => open,
sda => open,
scl => open,
shutdown_out => open,
therm_trip_rst => open,
-- thermal trips from onboard comparitors looking at therm_N/P[2:0] from head connectors
-- present on FLX-FD-SG600 V1.0
-- not present on FLX-FD-SG1024 V0.0
n_h0_therm_trip_in => (others => '0'),
n_h1_therm_trip_in => (others => '0'),
n_h2_therm_trip_in => (others => '0'),
n_h3_therm_trip_in => (others => '0'),
-- 3:0 = TRIP_VCC_HD, TRIP_I_VCC_HD, I_LIM_MAIN, I_LIM_BIAS
h0_shdn_trip_in => (others => '0'),
h1_shdn_trip_in => (others => '0'),
h2_shdn_trip_in => (others => '0'),
h3_shdn_trip_in => (others => '0')
);
end generate GEN_RX_SERDES;
-----------------------------------------
@ -739,10 +808,10 @@ begin
-- -- -- -- --print_data_combine(i) <= print_data(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH);
-- end generate;
print_data_combine(i) <= ZERO(MAX_OP_WIDTH - 1 downto MAX_OP_WIDTH / NUM_HEADS) &
print_data(i * MAX_OP_WIDTH / NUM_HEADS + MAX_OP_WIDTH / NUM_HEADS - 1 downto i * MAX_OP_WIDTH / NUM_HEADS)
when (not DYNAMIC_COMBINE) or combine_chans_int = '0'
print_data(i * MAX_OP_WIDTH / NUM_HEADS + MAX_OP_WIDTH / NUM_HEADS - 1 downto i * MAX_OP_WIDTH / NUM_HEADS)
when (not DYNAMIC_COMBINE) or combine_chans_int = '0'
else print_data(i * MAX_OP_WIDTH + MAX_OP_WIDTH - 1 downto i * MAX_OP_WIDTH);
end generate GEN_PRINT_RCVR;
@ -838,7 +907,7 @@ begin
PCLK_CLK_RATIO => PCLK_CLK_RATIO,
CLK_FREQ_MHZ => CLK_FREQ_MHZ,
SIM_TEST_MODE => true,
SLIM => TRIM_PS,
NO_ZERO_GAP => NO_ZERO_GAP,
DYNAMIC_COMBINE => DYNAMIC_COMBINE
)
port map(
@ -887,6 +956,12 @@ begin
axm_rvalid => axm_rvalid,
axm_rready => open,
avm_tx_waitrequest => avm_tx_waitrequest,
avm_tx_burstcount => avm_tx_burstcount,
avm_tx_address => avm_tx_address,
avm_tx_write => avm_tx_write,
avm_tx_writedata => avm_tx_writedata,
STM8_SWIM_OUT => swim_out_logic,
STM8_SWIM_IN => swim_in,
@ -917,13 +992,17 @@ begin
pio_in => pio_in,
ddr_out => open, -- not used in SG600
i2c_stat => (others => '0'),
i2c_ctrl => open,
lvds_tx_pio => lvds_tx_pio,
lvds_tx_ser => lvds_tx_ser,
TIMING_RX_P => '0',
TIMING_RX_N => open,
TIMING_TX_N => '0',
TIMING_TX_P => open
TIMING_RX_P => '0',
TIMING_TX_P_in => '0',
TIMING_TX_P_out => open,
TIMING_TX_P_oe => open,
TIMING_RX_N => open
);

View file

@ -1,4 +1,5 @@
onerror {resume}
quietly virtual signal -install /tb/core_inst { /tb/core_inst/dac_data_0(13 downto 0)} dac
quietly WaveActivateNextPane {} 0
add wave -noupdate -group tb /tb/CLK_FREQ_MHZ
add wave -noupdate -group tb /tb/DAC_CLK_BIT
@ -14,7 +15,6 @@ add wave -noupdate -group tb /tb/PCLK_CLK_RATIO
add wave -noupdate -group tb /tb/SHIFT_DEPTH
add wave -noupdate -group tb /tb/SWIM_MIN_ZERO_COUNT
add wave -noupdate -group tb /tb/SWIM_TIME_PERIOD
add wave -noupdate -group tb /tb/TRIM_PS
add wave -noupdate -group tb /tb/UART_TXD
add wave -noupdate -group tb /tb/VPROC_RD_LENGTH
add wave -noupdate -group tb /tb/VPROC_WR_LENGTH
@ -96,7 +96,6 @@ add wave -noupdate -group tb /tb/fan_sense
add wave -noupdate -group tb /tb/fire_req
add wave -noupdate -group tb /tb/fire_req_count
add wave -noupdate -group tb /tb/is_dynamic_combine
add wave -noupdate -group tb /tb/is_trim_ps
add wave -noupdate -group tb /tb/lvds_tx_pio
add wave -noupdate -group tb /tb/lvds_tx_ser
add wave -noupdate -group tb /tb/master_reg_access
@ -134,7 +133,9 @@ add wave -noupdate -group tb /tb/tb_pio_in_val
add wave -noupdate -group tb /tb/timeout
add wave -noupdate -group tb /tb/uart_tx_active
add wave -noupdate -group tb /tb/uart_tx_en
add wave -noupdate /tb/scratch
add wave -noupdate -expand -group core /tb/core_inst/CLK_FREQ_MHZ
add wave -noupdate -expand -group core /tb/core_inst/NUM_HEADS
add wave -noupdate -expand -group core /tb/core_inst/DYNAMIC_COMBINE
add wave -noupdate -expand -group core /tb/core_inst/ENA_DDR
add wave -noupdate -expand -group core /tb/core_inst/ENA_LVDS_PIO
@ -147,7 +148,6 @@ add wave -noupdate -expand -group core /tb/core_inst/LVDS_TX_CHANS
add wave -noupdate -expand -group core /tb/core_inst/MAX_HEADS
add wave -noupdate -expand -group core /tb/core_inst/MAX_OP_WIDTH
add wave -noupdate -expand -group core /tb/core_inst/NUM_DDR
add wave -noupdate -expand -group core /tb/core_inst/NUM_HEADS
add wave -noupdate -expand -group core /tb/core_inst/NUM_LVDS_DDR
add wave -noupdate -expand -group core /tb/core_inst/NUM_LVDS_RX_PIO
add wave -noupdate -expand -group core /tb/core_inst/NUM_LVDS_TX_PIO
@ -157,16 +157,13 @@ add wave -noupdate -expand -group core /tb/core_inst/OVR_RNG_TRIG_BIT
add wave -noupdate -expand -group core /tb/core_inst/PCLK_CLK_RATIO
add wave -noupdate -expand -group core /tb/core_inst/SHIFT_DEPTH
add wave -noupdate -expand -group core /tb/core_inst/SIM_TEST_MODE
add wave -noupdate -expand -group core /tb/core_inst/SLIM
add wave -noupdate -expand -group core /tb/core_inst/STM8_SWIM_IN
add wave -noupdate -expand -group core /tb/core_inst/STM8_SWIM_OUT
add wave -noupdate -expand -group core /tb/core_inst/TICKS_100MS
add wave -noupdate -expand -group core /tb/core_inst/TICKS_10US
add wave -noupdate -expand -group core /tb/core_inst/TICKS_50US
add wave -noupdate -expand -group core /tb/core_inst/TIMING_RX_N
add wave -noupdate -expand -group core /tb/core_inst/TIMING_RX_P
add wave -noupdate -expand -group core /tb/core_inst/TIMING_TX_N
add wave -noupdate -expand -group core /tb/core_inst/TIMING_TX_P
add wave -noupdate -expand -group core /tb/core_inst/TRIGGER_WIDTH
add wave -noupdate -expand -group core /tb/core_inst/TX_SERDES_RATIO
add wave -noupdate -expand -group core /tb/core_inst/UART_IRQ_hmb
@ -246,14 +243,6 @@ add wave -noupdate -expand -group core /tb/core_inst/en_test_pwr_ctrl
add wave -noupdate -expand -group core /tb/core_inst/fan_pwm
add wave -noupdate -expand -group core /tb/core_inst/fan_sense
add wave -noupdate -expand -group core /tb/core_inst/fault_state
add wave -noupdate -expand -group core /tb/core_inst/fire_mgr_read
add wave -noupdate -expand -group core /tb/core_inst/fire_mgr_readdata
add wave -noupdate -expand -group core /tb/core_inst/fire_mgr_readdata_int
add wave -noupdate -expand -group core /tb/core_inst/fire_mgr_waitrequest
add wave -noupdate -expand -group core /tb/core_inst/fire_mgr_write
add wave -noupdate -expand -group core /tb/core_inst/fire_pulse_mgr_active
add wave -noupdate -expand -group core /tb/core_inst/fire_pulse_mgr_read
add wave -noupdate -expand -group core /tb/core_inst/fire_pulse_mgr_write
add wave -noupdate -expand -group core /tb/core_inst/fire_req
add wave -noupdate -expand -group core /tb/core_inst/fire_req_fpm
add wave -noupdate -expand -group core /tb/core_inst/fire_req_test
@ -262,7 +251,6 @@ add wave -noupdate -expand -group core /tb/core_inst/flx_therm_trip_rst
add wave -noupdate -expand -group core /tb/core_inst/fpga_csr_read
add wave -noupdate -expand -group core /tb/core_inst/fpga_csr_readdata
add wave -noupdate -expand -group core /tb/core_inst/fpga_csr_write
add wave -noupdate -expand -group core /tb/core_inst/fpm_rx
add wave -noupdate -expand -group core /tb/core_inst/fpm_select_pof_niso
add wave -noupdate -expand -group core /tb/core_inst/freq_count
add wave -noupdate -expand -group core /tb/core_inst/freq_count_clr
@ -281,9 +269,6 @@ add wave -noupdate -expand -group core /tb/core_inst/hv_clk_phase90
add wave -noupdate -expand -group core /tb/core_inst/local_csr_read
add wave -noupdate -expand -group core /tb/core_inst/local_csr_readdata
add wave -noupdate -expand -group core /tb/core_inst/local_csr_write
add wave -noupdate -expand -group core /tb/core_inst/lvds_rx_csr_read
add wave -noupdate -expand -group core /tb/core_inst/lvds_rx_csr_readdata
add wave -noupdate -expand -group core /tb/core_inst/lvds_rx_csr_write
add wave -noupdate -expand -group core /tb/core_inst/lvds_tx_egress
add wave -noupdate -expand -group core /tb/core_inst/lvds_tx_par
add wave -noupdate -expand -group core /tb/core_inst/lvds_tx_pio
@ -310,9 +295,6 @@ add wave -noupdate -expand -group core /tb/core_inst/print_ctrl_write
add wave -noupdate -expand -group core /tb/core_inst/print_data
add wave -noupdate -expand -group core /tb/core_inst/print_data_int
add wave -noupdate -expand -group core /tb/core_inst/print_latch
add wave -noupdate -expand -group core /tb/core_inst/ps_rdy
add wave -noupdate -expand -group core /tb/core_inst/ps_wr
add wave -noupdate -expand -group core /tb/core_inst/ps_wr_data
add wave -noupdate -expand -group core /tb/core_inst/pwm_out_fan
add wave -noupdate -expand -group core /tb/core_inst/pwm_out_heat
add wave -noupdate -expand -group core /tb/core_inst/pwm_out_heat_int
@ -348,10 +330,203 @@ add wave -noupdate -expand -group core /tb/core_inst/uart_csr_readdata_som
add wave -noupdate -expand -group core /tb/core_inst/uart_csr_write_hmb
add wave -noupdate -expand -group core /tb/core_inst/uart_csr_write_som
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {3005000 ps} 0} {{Cursor 2} {102845000 ps} 0}
quietly WaveActivateNextPane
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_print_core_inst/start_req
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_start_addr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_busy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_start
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_start_seq_go
add wave -noupdate /tb/core_inst/print_ctrl_inst/cpu_start_seq_go
add wave -noupdate /tb/core_inst/print_ctrl_inst/cpu_start_seq_pulse
add wave -noupdate -format Analog-Step -height 74 -max 8190.0000000000009 -min -8172.0 /tb/core_inst/dac
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_seq_busy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wrreq
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/data
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wren
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wr_ptr_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/rdreq
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/GEN_AUX_LOOP(0)/GEN_PRINT_STREAMER_LOOP(0)/GEN_ZERO_GAP/data_streamer_inst/auto_cmd_active
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/avs_csr_address
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/avs_csr_write
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/avs_csr_writedata
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/GEN_AUX_LOOP(0)/GEN_PRINT_STREAMER_LOOP(0)/GEN_ZERO_GAP/data_streamer_inst/cmd_port_wr
add wave -noupdate /tb/core_inst/print_ctrl_inst/print_streamer_inst/avs_csr_write_int
add wave -noupdate -expand /tb/core_inst/print_ctrl_inst/print_streamer_inst/cmd_port_pulse
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/clk
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/rst_n
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_address
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_write
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_writedata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_read
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_readdata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_address
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_write
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_writedata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_read
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_readdata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_wr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_wr_data
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_rdy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_last_word
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_wr_aux
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_wr_data_aux
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_rdy_aux
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pixel_buf_last_word_aux
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/en_dual_data_path
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/all_on_emul
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/chan_en
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/bpp_mode
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_data_width
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/clear_buffer
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/empty
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/full
add wave -noupdate /tb/print_data_heads_rx_inst/GEN_PRINT_RX(0)/print_data_rx_inst/seen_latch
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/overrun
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/underrun
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fp_drop
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/dbl_drop
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/overlap_error
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/px_buf_ch_nactive
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_start_merge
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_data
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_gl_map
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_gl_map_en
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_fire_req_start_merge
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_fire_req_pulse
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_start_seq_go
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_start_seq_address
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_data_start
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_data_start_first
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_data_start_last
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_start_dly_head
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/cpu_adc_meas
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/stm8_trigger_rx
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/sig_seq_force_dacs_0v
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/dac_0v_value
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req_ext
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_addr_ext
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_delay_ext
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_dac_data
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/drop_stripe
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_busy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req_dly
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_seq_busy
add wave -noupdate -format Analog-Step -height 74 -max 8190.0000000000009 -min -8172.0 /tb/core_inst/dac
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/sequencers_busy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_latch
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wr_ptr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/pixel_buf_wr_shft
add wave -noupdate -expand /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_clk
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_data
add wave -noupdate /tb/core_inst/lvds_tx_par(11)
add wave -noupdate /tb/core_inst/lvds_tx_par(8)
add wave -noupdate /tb/core_inst/lvds_tx_par(0)
add wave -noupdate -expand -subitemconfig {/tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/rd_ptr(30) -expand} /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/rd_ptr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/start_req
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/start_req_first
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/start_req_last
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wr_ptr_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wr_ptr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/wren_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/rdreq
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/error
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/underrun
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/writing_first_stripe
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/pend_drop_detect
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/word_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/word_wrap
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_all_on
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_latch
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_sel
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_addr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_data
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_rdptr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_wrptr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_wdata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_peek_wr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_word_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/debug_out
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_write_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_read_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_rdata_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_write_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_read_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_read_seq_wave_dly
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_rdata_seq_wave
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_rdata_seq_wave_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_write_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_read_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_csr_rdata_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_write_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_read_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_read_seq_print_dly
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_rdata_seq_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/avs_seq_rdata_seq_print_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req_dly
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_addr_dly
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/vector_out
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/stm8_trigger_rx_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/trig_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/stm8_trigger_rx_int_d
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wav_trigger_in
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/vector_print
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_addr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_delay
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_req_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_addr_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/wave_delay_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_data_config
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_data_valid
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_data_ack
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_dac_data_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_start_req_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_start_first_pulse_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_start_last_pulse_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_held_off
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/sequencers_busy
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_start
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_start_addr
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_gl_map_update
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/seq_fp_holdoff_update
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_seq_trig
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_int_d
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/drop_stripe
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/pend_drop_detect
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/fp_drop
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/underrun
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/data_core_1/pixel_buffer_zg_inst/GEN_PX_BUF(0)/GEN_NO_ZG/pixel_buf_inst/word_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/fire_req_start_merge_int
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/delay_queue_write
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/delay_queue_read
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/delay_queue_readdata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/local_write
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/local_read
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/local_readdata
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/chan_active
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pulse_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pulse4096
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pulse_reset
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/pulse_reset_last
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_data_i
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_all_on_i
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/print_clk_i
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/allon_reg
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/allon_cnt
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/allon_pclk
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/allon_mux
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_fire_req_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_fire_simg_count
add wave -noupdate /tb/core_inst/print_ctrl_inst/GEN_PRINT_UNIT_LOOP(0)/print_unit_inst/diag_last_stripe_count
TreeUpdate [SetDefaultTree]
WaveRestoreCursors {{Cursor 1} {97322249 ps} 0} {{Cursor 2} {182525000 ps} 0}
quietly wave cursor active 2
configure wave -namecolwidth 173
configure wave -valuecolwidth 40
configure wave -valuecolwidth 66
configure wave -justifyvalue left
configure wave -signalnamewidth 1
configure wave -snapdistance 10
@ -364,4 +539,4 @@ configure wave -griddelta 40
configure wave -timeline 0
configure wave -timelineunits ns
update
WaveRestoreZoom {0 ps} {193137300 ps}
WaveRestoreZoom {0 ps} {458277888 ps}

View file

@ -51,100 +51,100 @@ use work.top_pkg.all;
entity top is
port(
memory_mem_a : out std_logic_vector(14 downto 0);
memory_mem_ba : out std_logic_vector(2 downto 0);
memory_mem_ck : out std_logic;
memory_mem_ck_n : out std_logic;
memory_mem_cke : out std_logic;
memory_mem_cs_n : out std_logic;
memory_mem_ras_n : out std_logic;
memory_mem_cas_n : out std_logic;
memory_mem_we_n : out std_logic;
memory_mem_reset_n : out std_logic;
memory_mem_dq : inout std_logic_vector(31 downto 0);
memory_mem_dqs : inout std_logic_vector(3 downto 0);
memory_mem_dqs_n : inout std_logic_vector(3 downto 0);
memory_mem_odt : out std_logic;
memory_mem_dm : out std_logic_vector(3 downto 0);
memory_oct_rzqin : in std_logic;
memory_mem_a : out std_logic_vector(15 downto 0);
memory_mem_ba : out std_logic_vector(2 downto 0);
memory_mem_ck : out std_logic;
memory_mem_ck_n : out std_logic;
memory_mem_cke : out std_logic;
memory_mem_cs_n : out std_logic;
memory_mem_ras_n : out std_logic;
memory_mem_cas_n : out std_logic;
memory_mem_we_n : out std_logic;
memory_mem_reset_n : out std_logic;
memory_mem_dq : inout std_logic_vector(31 downto 0);
memory_mem_dqs : inout std_logic_vector(3 downto 0);
memory_mem_dqs_n : inout std_logic_vector(3 downto 0);
memory_mem_odt : out std_logic;
memory_mem_dm : out std_logic_vector(3 downto 0);
memory_oct_rzqin : in std_logic;
hps_emac0_TX_CLK : out std_logic;
hps_emac0_TXD0 : out std_logic;
hps_emac0_TXD1 : out std_logic;
hps_emac0_TXD2 : out std_logic;
hps_emac0_TXD3 : out std_logic;
hps_emac0_RXD0 : in std_logic;
hps_emac0_MDIO : inout std_logic;
hps_emac0_MDC : inout std_logic;
hps_emac0_RX_CTL : in std_logic;
hps_emac0_TX_CTL : out std_logic;
hps_emac0_RX_CLK : in std_logic;
hps_emac0_RXD1 : in std_logic;
hps_emac0_RXD2 : in std_logic;
hps_emac0_RXD3 : in std_logic;
hps_emac0_TX_CLK : out std_logic;
hps_emac0_TXD0 : out std_logic;
hps_emac0_TXD1 : out std_logic;
hps_emac0_TXD2 : out std_logic;
hps_emac0_TXD3 : out std_logic;
hps_emac0_RXD0 : in std_logic;
hps_emac0_MDIO : inout std_logic;
hps_emac0_MDC : inout std_logic;
hps_emac0_RX_CTL : in std_logic;
hps_emac0_TX_CTL : out std_logic;
hps_emac0_RX_CLK : in std_logic;
hps_emac0_RXD1 : in std_logic;
hps_emac0_RXD2 : in std_logic;
hps_emac0_RXD3 : in std_logic;
hps_emac1_TX_CLK : out std_logic;
hps_emac1_TXD0 : out std_logic;
hps_emac1_TXD1 : out std_logic;
hps_emac1_TXD2 : out std_logic;
hps_emac1_TXD3 : out std_logic;
hps_emac1_RXD0 : in std_logic;
hps_emac1_MDIO : inout std_logic;
hps_emac1_MDC : inout std_logic;
hps_emac1_RX_CTL : in std_logic;
hps_emac1_TX_CTL : out std_logic;
hps_emac1_RX_CLK : in std_logic;
hps_emac1_RXD1 : in std_logic;
hps_emac1_RXD2 : in std_logic;
hps_emac1_RXD3 : in std_logic;
hps_emac1_TX_CLK : out std_logic;
hps_emac1_TXD0 : out std_logic;
hps_emac1_TXD1 : out std_logic;
hps_emac1_TXD2 : out std_logic;
hps_emac1_TXD3 : out std_logic;
hps_emac1_RXD0 : in std_logic;
hps_emac1_MDIO : inout std_logic;
hps_emac1_MDC : inout std_logic;
hps_emac1_RX_CTL : in std_logic;
hps_emac1_TX_CTL : out std_logic;
hps_emac1_RX_CLK : in std_logic;
hps_emac1_RXD1 : in std_logic;
hps_emac1_RXD2 : in std_logic;
hps_emac1_RXD3 : in std_logic;
hps_sdio_CLK : out std_logic;
hps_sdio_CMD : inout std_logic;
hps_sdio_D0 : inout std_logic;
hps_sdio_D1 : inout std_logic;
hps_sdio_D2 : inout std_logic;
hps_sdio_D3 : inout std_logic;
hps_sdio_D4 : inout std_logic;
hps_sdio_D5 : inout std_logic;
hps_sdio_D6 : inout std_logic;
hps_sdio_D7 : inout std_logic;
hps_sdio_CLK : out std_logic;
hps_sdio_CMD : inout std_logic;
hps_sdio_D0 : inout std_logic;
hps_sdio_D1 : inout std_logic;
hps_sdio_D2 : inout std_logic;
hps_sdio_D3 : inout std_logic;
hps_sdio_D4 : inout std_logic;
hps_sdio_D5 : inout std_logic;
hps_sdio_D6 : inout std_logic;
hps_sdio_D7 : inout std_logic;
hps_GPIO : inout std_logic_vector(24 downto 0);
hps_GPIO : inout std_logic_vector(24 downto 0);
SCL_SOM : inout std_logic;
SDA_SOM : inout std_logic;
SCL_APP : inout std_logic;
SDA_APP : inout std_logic;
SCL_SOM : inout std_logic;
SDA_SOM : inout std_logic;
SCL_APP : inout std_logic;
SDA_APP : inout std_logic;
FPGA_CLK_25 : in std_logic;
FPGA_CLK_19M2 : in std_logic;
FPGA_CLK_25 : in std_logic;
FPGA_CLK_19M2 : in std_logic;
P_GOOD : inout std_logic;
P_IN_GOOD : inout std_logic;
P_HOST_GOOD : inout std_logic;
LED : out std_logic_vector(5 downto 1);
TIMING_TX_P : out std_logic;
TIMING_TX_N : in std_logic;
TIMING_RX_P : in std_logic;
TIMING_RX_N : out std_logic;
STM8_ALERT_TX : inout std_logic;
STM8_TRIGGER_RX : inout std_logic;
P_GOOD : inout std_logic;
P_IN_GOOD : inout std_logic;
P_HOST_GOOD : inout std_logic;
LED : out std_logic_vector(5 downto 1);
TIMING_TX_P : inout std_logic;
TIMING_TX_N : in std_logic;
TIMING_RX_P : in std_logic;
TIMING_RX_N : out std_logic;
STM8_ALERT_TX : inout std_logic;
STM8_TRIGGER_RX : inout std_logic;
SWIM : inout std_logic; -- SWIM Interface to SOM STM8 (and cascaded to Host)
SWIM : inout std_logic; -- SWIM Interface to SOM STM8 (and cascaded to Host)
HOST_5V_EN : out std_logic;
HOST_3V3_EN : out std_logic;
HOST_2V5_EN : out std_logic;
HOST_1V5_EN : out std_logic;
HOST_1V2_EN : out std_logic;
HOST_1V1_EN : out std_logic;
RX_P : inout std_logic_vector(27 downto 0);
RX_N : inout std_logic_vector(27 downto 0);
TX_P : out std_logic_vector(16 downto 0);
TX_P_SSE : inout std_logic_vector(28 downto 17);
TX_N_SSE : inout std_logic_vector(28 downto 17);
HOST_PWR_EN : out std_logic;
NC : in std_logic_vector(6 downto 0)
HOST_5V_EN : out std_logic;
HOST_3V3_EN : out std_logic;
HOST_2V5_EN : out std_logic;
HOST_1V5_EN : out std_logic;
HOST_1V2_EN : out std_logic;
HOST_1V1_EN : out std_logic;
RX_P : inout std_logic_vector(27 downto 0);
RX_N : inout std_logic_vector(27 downto 0);
TX_P : out std_logic_vector(16 downto 0);
TX_P_SSE : inout std_logic_vector(28 downto 17);
TX_N_SSE : inout std_logic_vector(28 downto 17);
HOST_PWR_EN : out std_logic;
NC : in std_logic_vector(6 downto 0)
);
end entity top;
@ -218,6 +218,12 @@ architecture rtl of top is
signal i2c1_clk_in : std_logic;
signal i2c1_in_data : std_logic;
signal TIMING_TX_P_in : std_logic;
signal TIMING_TX_P_out : std_logic;
signal TIMING_TX_P_oe : std_logic;
signal i2c_ctrl : std_logic_vector(31 downto 0);
signal i2c_stat : std_logic_vector(31 downto 0) := (others => '0');
signal debug_output : std_logic_vector(4 downto 0);
------------------------------------------------------------------------------
@ -225,30 +231,30 @@ architecture rtl of top is
------------------------------------------------------------------------------
component hps_reset is
port(
probe : in std_logic;
source_clk : in std_logic;
source : out std_logic_vector(2 downto 0)
);
port(
probe : in std_logic;
source_clk : in std_logic;
source : out std_logic_vector(2 downto 0)
);
end component hps_reset;
component altera_edge_detector is
port(
clk : in std_logic;
rst_n : in std_logic;
signal_in : in std_logic;
pulse_out : out std_logic
);
port(
clk : in std_logic;
rst_n : in std_logic;
signal_in : in std_logic;
pulse_out : out std_logic
);
end component altera_edge_detector;
begin
-- Priority encode the head I2C enables (active low) to avoid contention
ni2c_head_en <= "1110" when lvds_tx_tmp(LVDS_TX_HD0_NI2C_HEAD_EN) = '0' else
"1101" when lvds_tx_tmp(LVDS_TX_HD1_NI2C_HEAD_EN) = '0' else
"1011" when lvds_tx_tmp(LVDS_TX_HD2_NI2C_HEAD_EN) = '0' else
"0111" when lvds_tx_tmp(LVDS_TX_HD3_NI2C_HEAD_EN) = '0' else
"1111";
"1101" when lvds_tx_tmp(LVDS_TX_HD1_NI2C_HEAD_EN) = '0' else
"1011" when lvds_tx_tmp(LVDS_TX_HD2_NI2C_HEAD_EN) = '0' else
"0111" when lvds_tx_tmp(LVDS_TX_HD3_NI2C_HEAD_EN) = '0' else
"1111";
TX_P_SSE(TX_P_HD0_NI2C_HEAD_EN) <= ni2c_head_en(0); -- HD0 nI2C_HEAD_EN
TX_N_SSE(TX_N_HD1_NI2C_HEAD_EN) <= ni2c_head_en(1); -- HD1 nI2C_HEAD_EN
@ -306,13 +312,22 @@ begin
--LED <= dac_spim_oe_n_int & dac_spim_cs_n(0) & pio_out(9) & lvds_tx_tmp(LVDS_TX_NC0) & dac_sim_sclk;
--LED <= debug_output;
-- LED <= i2c0_out_data&
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) &
-- i2c1_out_data &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) &
-- i2c1_out_data &
-- hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SDA);
LED <= debug_output(4) & debug_output(3) & debug_output(2) & debug_output(1) & debug_output(0);
i2c_stat(I2C_STAT_HEAD_SDA_IP) <= i2c0_in_data;
i2c_stat(I2C_STAT_HEAD_SCL_IP) <= i2c0_clk_in;
i2c_stat(I2C_STAT_HEAD_SDA_OP) <= i2c0_out_data;
i2c_stat(I2C_STAT_HEAD_SCL_OP) <= i2c0_clk;
i2c_stat(I2C_STAT_SOM_SDA_IP) <= i2c1_in_data;
i2c_stat(I2C_STAT_SOM_SCL_IP) <= i2c1_clk_in;
i2c_stat(I2C_STAT_SOM_SDA_OP) <= i2c1_out_data;
i2c_stat(I2C_STAT_SOM_SCL_OP) <= i2c1_clk;
STM8_TRIGGER_RX <= pio_out(PIO_OUT_SOM_STM8_TRIGGER_RX);
HOST_5V_EN <= pio_out(PIO_OUT_HOST_5V_EN);
HOST_3V3_EN <= pio_out(PIO_OUT_HOST_3V3_EN);
@ -366,7 +381,7 @@ begin
TX_P_SSE(TX_P_HD1_SWIM) <= 'Z' when swim_tx(2) = '1' else '0';
TX_P_SSE(TX_P_HD2_SWIM) <= 'Z' when swim_tx(3) = '1' else '0';
TX_P_SSE(TX_P_HD3_SWIM) <= 'Z' when swim_tx(4) = '1' else '0';
-- AMP/LIMIT control
RX_P(RX_P_AMP_EN) <= pio_out(PIO_OUT_AMP_EN); -- HDx AMP_EN
@ -413,6 +428,9 @@ begin
RX_P(RX_P_DAC1_DCLKIO) <= dac_data_1(DAC_DATA_CLK); -- DCLKIO
RX_N(RX_N_DAC1_CLKIN) <= dac_data_1(DAC_DATA_CLK); -- CLKIN
TIMING_TX_P <= TIMING_TX_P_out when TIMING_TX_P_oe = '1' else 'Z';
TIMING_TX_P_in <= TIMING_TX_P;
-- DAC0/1 SPI interface
dac_spim_oe_n_int <= dac_spim_oe_n or lvds_tx_tmp(SPI_OE_MASK); -- See Jira HMBXR5601-93 for original issue on P4
@ -427,188 +445,188 @@ begin
RX_N(RX_N_DAC1_SPIM_SDIO) <= 'Z' when dac_spim_oe_n_int = '1' else dac_spim_sdio;
SPI_MISO <= not dac_spim_oe_n_int or ((RX_N(RX_N_DAC0_SPIM_SDIO) and not dac_spim_cs_n(0)) or
(RX_N(RX_N_DAC1_SPIM_SDIO) and not dac_spim_cs_n(1)));
(RX_N(RX_N_DAC1_SPIM_SDIO) and not dac_spim_cs_n(1)));
i2c0_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SCL);
i2c0_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SDA);
i2c0_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SCL);
i2c0_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SDA);
i2c1_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SCL);
i2c1_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_APP_SDA);
i2c1_clk_in <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SCL);
i2c1_in_data <= hps_0_h2f_loan_io_in(HPS_LOANIO_SOM_SDA);
hps_0_h2f_loan_io_out(HPS_LOANIO_SOM_SDA) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) <= i2c0_out_data or lvds_tx_tmp(LVDS_TX_SOM_SDA_MASK);
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SDA) <= i2c1_out_data or lvds_tx_tmp(LVDS_TX_SOM_SDA_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_SOM_SCL) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SCL) <= i2c0_clk or lvds_tx_tmp(LVDS_TX_SOM_SCL_MASK);
hps_0_h2f_loan_io_oe(HPS_LOANIO_SOM_SCL) <= i2c1_clk or lvds_tx_tmp(LVDS_TX_SOM_SCL_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_APP_SDA) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SDA) <= i2c1_out_data or lvds_tx_tmp(LVDS_TX_APP_SDA_MASK);
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SDA) <= i2c0_out_data or lvds_tx_tmp(LVDS_TX_APP_SDA_MASK);
hps_0_h2f_loan_io_out(HPS_LOANIO_APP_SCL) <= '0';
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) <= i2c1_clk or lvds_tx_tmp(LVDS_TX_APP_SCL_MASK);
hps_0_h2f_loan_io_oe(HPS_LOANIO_APP_SCL) <= (not i2c_ctrl(I2C_CTRL_HEAD_SCL_FORCE_EN) and (i2c0_clk or lvds_tx_tmp(LVDS_TX_APP_SCL_MASK)))
or ( i2c_ctrl(I2C_CTRL_HEAD_SCL_FORCE_EN) and not i2c_ctrl(I2C_CTRL_HEAD_SCL_FORCE_LVL)); -- Auto drive 9 clocks
-- QSYS top level block instantiation
top_system_1 : entity top_system.top_system
port map(
clk_clk => FPGA_CLK_25,
hps_0_f2h_cold_reset_req_reset_n => hps_cold_reset_n,
hps_0_f2h_debug_reset_req_reset_n => hps_debug_reset_n,
hps_0_f2h_warm_reset_req_reset_n => hps_warm_reset_n,
hps_0_h2f_reset_reset_n => hps_reset_n,
port map(
clk_clk => FPGA_CLK_25,
hps_0_f2h_cold_reset_req_reset_n => hps_cold_reset_n,
hps_0_f2h_debug_reset_req_reset_n => hps_debug_reset_n,
hps_0_f2h_warm_reset_req_reset_n => hps_warm_reset_n,
hps_0_h2f_reset_reset_n => hps_reset_n,
hps_0_h2f_loan_io_in => hps_0_h2f_loan_io_in,
hps_0_h2f_loan_io_out => hps_0_h2f_loan_io_out,
hps_0_h2f_loan_io_oe => hps_0_h2f_loan_io_oe,
hps_0_h2f_loan_io_in => hps_0_h2f_loan_io_in,
hps_0_h2f_loan_io_out => hps_0_h2f_loan_io_out,
hps_0_h2f_loan_io_oe => hps_0_h2f_loan_io_oe,
hps_0_hps_io_hps_io_emac0_inst_TX_CLK => hps_emac0_TX_CLK,
hps_0_hps_io_hps_io_emac0_inst_TXD0 => hps_emac0_TXD0,
hps_0_hps_io_hps_io_emac0_inst_TXD1 => hps_emac0_TXD1,
hps_0_hps_io_hps_io_emac0_inst_TXD2 => hps_emac0_TXD2,
hps_0_hps_io_hps_io_emac0_inst_TXD3 => hps_emac0_TXD3,
hps_0_hps_io_hps_io_emac0_inst_RXD0 => hps_emac0_RXD0,
hps_0_hps_io_hps_io_emac0_inst_MDIO => hps_emac0_MDIO,
hps_0_hps_io_hps_io_emac0_inst_MDC => hps_emac0_MDC,
hps_0_hps_io_hps_io_emac0_inst_RX_CTL => hps_emac0_RX_CTL,
hps_0_hps_io_hps_io_emac0_inst_TX_CTL => hps_emac0_TX_CTL,
hps_0_hps_io_hps_io_emac0_inst_RX_CLK => hps_emac0_RX_CLK,
hps_0_hps_io_hps_io_emac0_inst_RXD1 => hps_emac0_RXD1,
hps_0_hps_io_hps_io_emac0_inst_RXD2 => hps_emac0_RXD2,
hps_0_hps_io_hps_io_emac0_inst_RXD3 => hps_emac0_RXD3,
hps_0_hps_io_hps_io_emac1_inst_TX_CLK => hps_emac1_TX_CLK,
hps_0_hps_io_hps_io_emac1_inst_TXD0 => hps_emac1_TXD0,
hps_0_hps_io_hps_io_emac1_inst_TXD1 => hps_emac1_TXD1,
hps_0_hps_io_hps_io_emac1_inst_TXD2 => hps_emac1_TXD2,
hps_0_hps_io_hps_io_emac1_inst_TXD3 => hps_emac1_TXD3,
hps_0_hps_io_hps_io_emac1_inst_RXD0 => hps_emac1_RXD0,
hps_0_hps_io_hps_io_emac1_inst_MDIO => hps_emac1_MDIO,
hps_0_hps_io_hps_io_emac1_inst_MDC => hps_emac1_MDC,
hps_0_hps_io_hps_io_emac1_inst_RX_CTL => hps_emac1_RX_CTL,
hps_0_hps_io_hps_io_emac1_inst_TX_CTL => hps_emac1_TX_CTL,
hps_0_hps_io_hps_io_emac1_inst_RX_CLK => hps_emac1_RX_CLK,
hps_0_hps_io_hps_io_emac1_inst_RXD1 => hps_emac1_RXD1,
hps_0_hps_io_hps_io_emac1_inst_RXD2 => hps_emac1_RXD2,
hps_0_hps_io_hps_io_emac1_inst_RXD3 => hps_emac1_RXD3,
hps_0_hps_io_hps_io_sdio_inst_CMD => hps_sdio_CMD,
hps_0_hps_io_hps_io_sdio_inst_D0 => hps_sdio_D0,
hps_0_hps_io_hps_io_sdio_inst_D1 => hps_sdio_D1,
hps_0_hps_io_hps_io_sdio_inst_CLK => hps_sdio_CLK,
hps_0_hps_io_hps_io_sdio_inst_D2 => hps_sdio_D2,
hps_0_hps_io_hps_io_sdio_inst_D3 => hps_sdio_D3,
hps_0_hps_io_hps_io_sdio_inst_D4 => hps_sdio_D4,
hps_0_hps_io_hps_io_sdio_inst_D5 => hps_sdio_D5,
hps_0_hps_io_hps_io_sdio_inst_D6 => hps_sdio_D6,
hps_0_hps_io_hps_io_sdio_inst_D7 => hps_sdio_D7,
--hps_0_hps_io_hps_io_i2c1_inst_SDA => SDA_APP,
--hps_0_hps_io_hps_io_i2c1_inst_SCL => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO28 => hps_GPIO(HPS_GPIO_BSEL2_GPIO_3V3_0), -- HPS_BSEL2/GPIO_3V3_0
hps_0_hps_io_hps_io_gpio_inst_LOANIO29 => hps_GPIO(HPS_GPIO_GPIO_3V3_1), -- GPIO_3V3_1
hps_0_hps_io_hps_io_gpio_inst_LOANIO30 => hps_GPIO(HPS_GPIO_GPIO_3V3_2), -- GPIO_3V3_2
hps_0_hps_io_hps_io_gpio_inst_GPIO31 => hps_GPIO(HPS_GPIO_GBE0_NRESET), -- GbE0_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO32 => hps_GPIO(HPS_GPIO_GBE0_PHY_NINT), -- GbE0_PHY_nINT (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO33 => hps_GPIO(HPS_GPIO_BSEL1_GPIO_3V3_3), -- HPS_BSEL1/GPIO_3V3_3
hps_0_hps_io_hps_io_gpio_inst_GPIO34 => hps_GPIO(HPS_GPIO_GBE1_NRESET), -- GbE1_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO35 => hps_GPIO(HPS_GPIO_GBE1_PHY_NINT), -- GbE1_PHY_nINT
hps_0_hps_io_hps_io_gpio_inst_LOANIO37 => hps_GPIO(HPS_GPIO_GPIO_3V3_4), -- GPIO_3V3_4
hps_0_hps_io_hps_io_gpio_inst_GPIO44 => hps_GPIO(HPS_GPIO_GPIO_3V3_5), -- GPIO_3V3_5
hps_0_hps_io_hps_io_gpio_inst_GPIO48 => hps_GPIO(HPS_GPIO_SD_PRESENT), -- SD_PRESENT (input)
hps_0_hps_io_hps_io_gpio_inst_GPIO49 => hps_GPIO(HPS_GPIO_GPIO_3V3_6), -- GPIO_3V3_6
hps_0_hps_io_hps_io_gpio_inst_LOANIO50 => hps_GPIO(HPS_GPIO_LED_G), -- nHPS_LED_G
hps_0_hps_io_hps_io_gpio_inst_LOANIO53 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_INIT_DONE), -- HMB FPGA INIT_DONE/CAN_RX (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO54 => hps_GPIO(HPS_GPIO_CAN_TX), -- CAN_TX
hps_0_hps_io_hps_io_gpio_inst_LOANIO55 => hps_GPIO(HPS_GPIO_LED_Y), -- nHPS_LED_Y
hps_0_hps_io_hps_io_gpio_inst_LOANIO56 => hps_GPIO(HPS_GPIO_LED_R), -- nHPS_LED_R
hps_0_hps_io_hps_io_emac0_inst_TX_CLK => hps_emac0_TX_CLK,
hps_0_hps_io_hps_io_emac0_inst_TXD0 => hps_emac0_TXD0,
hps_0_hps_io_hps_io_emac0_inst_TXD1 => hps_emac0_TXD1,
hps_0_hps_io_hps_io_emac0_inst_TXD2 => hps_emac0_TXD2,
hps_0_hps_io_hps_io_emac0_inst_TXD3 => hps_emac0_TXD3,
hps_0_hps_io_hps_io_emac0_inst_RXD0 => hps_emac0_RXD0,
hps_0_hps_io_hps_io_emac0_inst_MDIO => hps_emac0_MDIO,
hps_0_hps_io_hps_io_emac0_inst_MDC => hps_emac0_MDC,
hps_0_hps_io_hps_io_emac0_inst_RX_CTL => hps_emac0_RX_CTL,
hps_0_hps_io_hps_io_emac0_inst_TX_CTL => hps_emac0_TX_CTL,
hps_0_hps_io_hps_io_emac0_inst_RX_CLK => hps_emac0_RX_CLK,
hps_0_hps_io_hps_io_emac0_inst_RXD1 => hps_emac0_RXD1,
hps_0_hps_io_hps_io_emac0_inst_RXD2 => hps_emac0_RXD2,
hps_0_hps_io_hps_io_emac0_inst_RXD3 => hps_emac0_RXD3,
hps_0_hps_io_hps_io_emac1_inst_TX_CLK => hps_emac1_TX_CLK,
hps_0_hps_io_hps_io_emac1_inst_TXD0 => hps_emac1_TXD0,
hps_0_hps_io_hps_io_emac1_inst_TXD1 => hps_emac1_TXD1,
hps_0_hps_io_hps_io_emac1_inst_TXD2 => hps_emac1_TXD2,
hps_0_hps_io_hps_io_emac1_inst_TXD3 => hps_emac1_TXD3,
hps_0_hps_io_hps_io_emac1_inst_RXD0 => hps_emac1_RXD0,
hps_0_hps_io_hps_io_emac1_inst_MDIO => hps_emac1_MDIO,
hps_0_hps_io_hps_io_emac1_inst_MDC => hps_emac1_MDC,
hps_0_hps_io_hps_io_emac1_inst_RX_CTL => hps_emac1_RX_CTL,
hps_0_hps_io_hps_io_emac1_inst_TX_CTL => hps_emac1_TX_CTL,
hps_0_hps_io_hps_io_emac1_inst_RX_CLK => hps_emac1_RX_CLK,
hps_0_hps_io_hps_io_emac1_inst_RXD1 => hps_emac1_RXD1,
hps_0_hps_io_hps_io_emac1_inst_RXD2 => hps_emac1_RXD2,
hps_0_hps_io_hps_io_emac1_inst_RXD3 => hps_emac1_RXD3,
hps_0_hps_io_hps_io_sdio_inst_CMD => hps_sdio_CMD,
hps_0_hps_io_hps_io_sdio_inst_D0 => hps_sdio_D0,
hps_0_hps_io_hps_io_sdio_inst_D1 => hps_sdio_D1,
hps_0_hps_io_hps_io_sdio_inst_CLK => hps_sdio_CLK,
hps_0_hps_io_hps_io_sdio_inst_D2 => hps_sdio_D2,
hps_0_hps_io_hps_io_sdio_inst_D3 => hps_sdio_D3,
hps_0_hps_io_hps_io_sdio_inst_D4 => hps_sdio_D4,
hps_0_hps_io_hps_io_sdio_inst_D5 => hps_sdio_D5,
hps_0_hps_io_hps_io_sdio_inst_D6 => hps_sdio_D6,
hps_0_hps_io_hps_io_sdio_inst_D7 => hps_sdio_D7,
--hps_0_hps_io_hps_io_i2c1_inst_SDA => SDA_APP,
--hps_0_hps_io_hps_io_i2c1_inst_SCL => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO28 => hps_GPIO(HPS_GPIO_BSEL2_GPIO_3V3_0), -- HPS_BSEL2/GPIO_3V3_0
hps_0_hps_io_hps_io_gpio_inst_LOANIO29 => hps_GPIO(HPS_GPIO_GPIO_3V3_1), -- GPIO_3V3_1
hps_0_hps_io_hps_io_gpio_inst_LOANIO30 => hps_GPIO(HPS_GPIO_GPIO_3V3_2), -- GPIO_3V3_2
hps_0_hps_io_hps_io_gpio_inst_GPIO31 => hps_GPIO(HPS_GPIO_GBE0_NRESET), -- GbE0_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO32 => hps_GPIO(HPS_GPIO_GBE0_PHY_NINT), -- GbE0_PHY_nINT (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO33 => hps_GPIO(HPS_GPIO_BSEL1_GPIO_3V3_3), -- HPS_BSEL1/GPIO_3V3_3
hps_0_hps_io_hps_io_gpio_inst_GPIO34 => hps_GPIO(HPS_GPIO_GBE1_NRESET), -- GbE1_nRESET
hps_0_hps_io_hps_io_gpio_inst_GPIO35 => hps_GPIO(HPS_GPIO_GBE1_PHY_NINT), -- GbE1_PHY_nINT
hps_0_hps_io_hps_io_gpio_inst_LOANIO37 => hps_GPIO(HPS_GPIO_GPIO_3V3_4), -- GPIO_3V3_4
hps_0_hps_io_hps_io_gpio_inst_GPIO44 => hps_GPIO(HPS_GPIO_GPIO_3V3_5), -- GPIO_3V3_5
hps_0_hps_io_hps_io_gpio_inst_GPIO48 => hps_GPIO(HPS_GPIO_SD_PRESENT), -- SD_PRESENT (input)
hps_0_hps_io_hps_io_gpio_inst_GPIO49 => hps_GPIO(HPS_GPIO_GPIO_3V3_6), -- GPIO_3V3_6
hps_0_hps_io_hps_io_gpio_inst_LOANIO50 => hps_GPIO(HPS_GPIO_LED_G), -- nHPS_LED_G
hps_0_hps_io_hps_io_gpio_inst_LOANIO53 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_INIT_DONE), -- HMB FPGA INIT_DONE/CAN_RX (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO54 => hps_GPIO(HPS_GPIO_CAN_TX), -- CAN_TX
hps_0_hps_io_hps_io_gpio_inst_LOANIO55 => hps_GPIO(HPS_GPIO_LED_Y), -- nHPS_LED_Y
hps_0_hps_io_hps_io_gpio_inst_LOANIO56 => hps_GPIO(HPS_GPIO_LED_R), -- nHPS_LED_R
hps_0_hps_io_hps_io_gpio_inst_LOANIO57 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DCLK), -- HMB FPGA DCLK
hps_0_hps_io_hps_io_gpio_inst_LOANIO58 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DATA), -- HMB FPGA DATA
hps_0_hps_io_hps_io_gpio_inst_LOANIO59 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_CONFIG_DONE), -- HMB FPGA CONFIG_DONE
hps_0_hps_io_hps_io_gpio_inst_LOANIO60 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NCONFIG), -- HMB FPGA NCONFIG
hps_0_hps_io_hps_io_gpio_inst_LOANIO61 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NSTATUS), -- HMB FPGA NSTATUS (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO57 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DCLK), -- HMB FPGA DCLK
hps_0_hps_io_hps_io_gpio_inst_LOANIO58 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_DATA), -- HMB FPGA DATA
hps_0_hps_io_hps_io_gpio_inst_LOANIO59 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_CONFIG_DONE), -- HMB FPGA CONFIG_DONE
hps_0_hps_io_hps_io_gpio_inst_LOANIO60 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NCONFIG), -- HMB FPGA NCONFIG
hps_0_hps_io_hps_io_gpio_inst_LOANIO61 => hps_GPIO(HPS_GPIO_LOANIO_FPGA_NSTATUS), -- HMB FPGA NSTATUS (input)
hps_0_hps_io_hps_io_gpio_inst_LOANIO63 => SDA_SOM,
hps_0_hps_io_hps_io_gpio_inst_LOANIO64 => SCL_SOM,
hps_0_hps_io_hps_io_gpio_inst_LOANIO51 => SDA_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO52 => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO63 => SDA_APP,
hps_0_hps_io_hps_io_gpio_inst_LOANIO64 => SCL_APP,
hps_0_hps_io_hps_io_gpio_inst_GPIO62 => hps_GPIO(HPS_GPIO_FORCE_EEMC_CLKSEL1), -- FORCE_EMMC/CLKSEL1
hps_0_hps_io_hps_io_uart0_inst_RX => hps_GPIO(HPS_GPIO_HPS_RX), -- HPS_RX
hps_0_hps_io_hps_io_uart0_inst_TX => hps_GPIO(HPS_GPIO_HPS_TX), -- HPS_TX
hps_0_hps_io_hps_io_gpio_inst_LOANIO51 => SDA_SOM,
hps_0_hps_io_hps_io_gpio_inst_LOANIO52 => SCL_SOM,
hps_0_spim0_rxd => SPI_MISO,
hps_0_spim0_ss_in_n => '1', -- Motorola SPI frame format (0 = TI SSP).
hps_0_spim0_ssi_oe_n => dac_spim_oe_n,
hps_0_spim0_ss_0_n => dac_spim_cs_n(0),
hps_0_spim0_ss_1_n => dac_spim_cs_n(1),
hps_0_spim0_ss_2_n => dac_spim_cs_n(2),
hps_0_spim0_ss_3_n => dac_spim_cs_n(3),
hps_0_spim0_txd => dac_spim_sdio,
hps_0_spim0_sclk_out_clk => dac_sim_sclk,
hps_0_hps_io_hps_io_gpio_inst_GPIO62 => hps_GPIO(HPS_GPIO_FORCE_EEMC_CLKSEL1), -- FORCE_EMMC/CLKSEL1
hps_0_hps_io_hps_io_uart0_inst_RX => hps_GPIO(HPS_GPIO_HPS_RX), -- HPS_RX
hps_0_hps_io_hps_io_uart0_inst_TX => hps_GPIO(HPS_GPIO_HPS_TX), -- HPS_TX
hps_0_i2c0_out_data => i2c0_out_data,
hps_0_i2c0_sda => i2c0_in_data,
hps_0_i2c0_clk_clk => i2c0_clk,
hps_0_i2c0_scl_in_clk => i2c0_clk_in,
hps_0_i2c1_out_data => i2c1_out_data,
hps_0_i2c1_sda => i2c1_in_data,
hps_0_i2c1_clk_clk => i2c1_clk,
hps_0_i2c1_scl_in_clk => i2c1_clk_in,
hps_0_spim0_rxd => SPI_MISO,
hps_0_spim0_ss_in_n => '1', -- Motorola SPI frame format (0 = TI SSP).
hps_0_spim0_ssi_oe_n => dac_spim_oe_n,
hps_0_spim0_ss_0_n => dac_spim_cs_n(0),
hps_0_spim0_ss_1_n => dac_spim_cs_n(1),
hps_0_spim0_ss_2_n => dac_spim_cs_n(2),
hps_0_spim0_ss_3_n => dac_spim_cs_n(3),
hps_0_spim0_txd => dac_spim_sdio,
hps_0_spim0_sclk_out_clk => dac_sim_sclk,
timing_tx_n => TIMING_TX_N,
timing_rx_p => TIMING_RX_P,
timing_tx_p => TIMING_TX_P,
hps_0_i2c0_out_data => i2c0_out_data,
hps_0_i2c0_sda => i2c0_in_data,
hps_0_i2c0_clk_clk => i2c0_clk,
hps_0_i2c0_scl_in_clk => i2c0_clk_in,
hps_0_i2c1_out_data => i2c1_out_data,
hps_0_i2c1_sda => i2c1_in_data,
hps_0_i2c1_clk_clk => i2c1_clk,
hps_0_i2c1_scl_in_clk => i2c1_clk_in,
timing_tx_n => TIMING_TX_N,
timing_rx_p => TIMING_RX_P,
timing_tx_p_in => TIMING_TX_P_in,
timing_tx_p_out => TIMING_TX_P_out,
timing_tx_p_oe => TIMING_TX_P_oe,
timing_rx_n => TIMING_RX_N,
lvds_tx_ser => TX_P(TX_P_LVDS_SER),
lvds_tx_pio => lvds_tx_tmp,
memory_mem_a => memory_mem_a,
memory_mem_ba => memory_mem_ba,
memory_mem_ck => memory_mem_ck,
memory_mem_ck_n => memory_mem_ck_n,
memory_mem_cke => memory_mem_cke,
memory_mem_cs_n => memory_mem_cs_n,
memory_mem_ras_n => memory_mem_ras_n,
memory_mem_cas_n => memory_mem_cas_n,
memory_mem_we_n => memory_mem_we_n,
memory_mem_reset_n => memory_mem_reset_n,
memory_mem_dq => memory_mem_dq,
memory_mem_dqs => memory_mem_dqs,
memory_mem_dqs_n => memory_mem_dqs_n,
memory_mem_odt => memory_mem_odt,
memory_mem_dm => memory_mem_dm,
memory_oct_rzqin => memory_oct_rzqin,
pio_pio_in => pio_in,
pio_pio_out => pio_out,
pio_pio_out_en => open,
reset_reset_n => hps_reset_n,
swim_rx => swim_rx,
swim_tx => swim_tx,
fpga_cfg_dclk => fpga_cfg_dclk,
fpga_cfg_data => fpga_cfg_data,
fpga_cfg_done => fpga_cfg_done,
fpga_cfg_nstatus => fpga_cfg_nstatus,
fpga_cfg_nconfig => fpga_cfg_nconfig,
fpga_cfg_init_done => fpga_cfg_init_done,
fpga_cfg_oe => fpga_cfg_oe,
pwm_out_fan => fan_pwm,
pwm_out_heat => heater_en,
pwm_fan_sense => fan_sense,
hv_clk_phase0 => hv_clk_phase0,
hv_clk_phase90 => hv_clk_phase90,
hv_clk_phase180 => hv_clk_phase180,
hv_clk_phase270 => hv_clk_phase270,
dac_data_0 => dac_data_0,
dac_data_1 => dac_data_1,
debug_output => debug_output
);
lvds_tx_ser => TX_P(TX_P_LVDS_SER),
lvds_tx_pio => lvds_tx_tmp,
memory_mem_a => memory_mem_a,
memory_mem_ba => memory_mem_ba,
memory_mem_ck => memory_mem_ck,
memory_mem_ck_n => memory_mem_ck_n,
memory_mem_cke => memory_mem_cke,
memory_mem_cs_n => memory_mem_cs_n,
memory_mem_ras_n => memory_mem_ras_n,
memory_mem_cas_n => memory_mem_cas_n,
memory_mem_we_n => memory_mem_we_n,
memory_mem_reset_n => memory_mem_reset_n,
memory_mem_dq => memory_mem_dq,
memory_mem_dqs => memory_mem_dqs,
memory_mem_dqs_n => memory_mem_dqs_n,
memory_mem_odt => memory_mem_odt,
memory_mem_dm => memory_mem_dm,
memory_oct_rzqin => memory_oct_rzqin,
pio_pio_in => pio_in,
pio_pio_out => pio_out,
pio_pio_out_en => open,
reset_reset_n => hps_reset_n,
-- Tie off signals for HV that are unused.
--memory_mem_a(15) <= '0';
--memory_mem_cke(1) <= '0';
--memory_mem_cs_n(1) <= '0';
--memory_mem_odt(1) <= '0';
i2c_i2c_ctrl => i2c_ctrl,
i2c_i2c_stat => i2c_stat,
swim_rx => swim_rx,
swim_tx => swim_tx,
fpga_cfg_dclk => fpga_cfg_dclk,
fpga_cfg_data => fpga_cfg_data,
fpga_cfg_done => fpga_cfg_done,
fpga_cfg_nstatus => fpga_cfg_nstatus,
fpga_cfg_nconfig => fpga_cfg_nconfig,
fpga_cfg_init_done => fpga_cfg_init_done,
fpga_cfg_oe => fpga_cfg_oe,
pwm_out_fan => fan_pwm,
pwm_out_heat => heater_en,
pwm_fan_sense => fan_sense,
hv_clk_phase0 => hv_clk_phase0,
hv_clk_phase90 => hv_clk_phase90,
hv_clk_phase180 => hv_clk_phase180,
hv_clk_phase270 => hv_clk_phase270,
dac_data_0 => dac_data_0,
dac_data_1 => dac_data_1,
debug_output => debug_output
);
hps_cold_reset_n <= not hps_cold_reset;
hps_warm_reset_n <= not hps_warm_reset;
@ -616,45 +634,45 @@ begin
-- Source/Probe megawizard instance
hps_reset_inst : hps_reset
port map(
probe => '0',
source_clk => FPGA_CLK_25,
source => hps_reset_req
);
port map(
probe => '0',
source_clk => FPGA_CLK_25,
source => hps_reset_req
);
pulse_cold_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(0),
pulse_out => hps_cold_reset
);
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(0),
pulse_out => hps_cold_reset
);
--defparam pulse_cold_reset.PULSE_EXT = 6;
--defparam pulse_cold_reset.EDGE_TYPE = 1;
--defparam pulse_cold_reset.IGNORE_RST_WHILE_BUSY = 1;
pulse_warm_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(1),
pulse_out => hps_warm_reset
);
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(1),
pulse_out => hps_warm_reset
);
--defparam pulse_warm_reset.PULSE_EXT = 2;
--defparam pulse_warm_reset.EDGE_TYPE = 1;
--defparam pulse_warm_reset.IGNORE_RST_WHILE_BUSY = 1;
pulse_debug_reset : altera_edge_detector
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(2),
pulse_out => hps_debug_reset
);
port map(
clk => FPGA_CLK_25,
rst_n => hps_reset_n,
signal_in => hps_reset_req(2),
pulse_out => hps_debug_reset
);
--defparam pulse_debug_reset.PULSE_EXT = 32;
--defparam pulse_debug_reset.EDGE_TYPE = 1;
--defparam pulse_debug_reset.IGNORE_RST_WHILE_BUSY = 1;
--defparam pulse_debug_reset.PULSE_EXT = 32;
--defparam pulse_debug_reset.EDGE_TYPE = 1;
--defparam pulse_debug_reset.IGNORE_RST_WHILE_BUSY = 1;
end;

View file

@ -82,10 +82,10 @@ package top_pkg is
constant LVDS_TX_HEAD_MUX1 : integer := 21;
constant LVDS_TX_HV_EN0 : integer := 22;
constant LVDS_TX_HV_EN1 : integer := 23;
constant LVDS_TX_SOM_SDA_MASK : integer := 24;
constant LVDS_TX_APP_SDA_MASK : integer := 25;
constant LVDS_TX_SOM_SCL_MASK : integer := 28;
constant LVDS_TX_APP_SCL_MASK : integer := 29;
constant LVDS_TX_APP_SDA_MASK : integer := 24;
constant LVDS_TX_SOM_SDA_MASK : integer := 25;
constant LVDS_TX_APP_SCL_MASK : integer := 28;
constant LVDS_TX_SOM_SCL_MASK : integer := 29;
constant TX_P_HEAD_MUX0 : integer := 28;
constant TX_N_HEAD_MUX1 : integer := 28;
@ -116,6 +116,18 @@ package top_pkg is
constant PIO_OUT_SOM_STM8_TRIGGER_RX : integer := 7;
constant PIO_OUT_SEL_STM8_TRIG_CPU_CTRL : integer := 8;
constant I2C_STAT_HEAD_SDA_IP : integer := 0;
constant I2C_STAT_HEAD_SCL_IP : integer := 1;
constant I2C_STAT_HEAD_SDA_OP : integer := 2;
constant I2C_STAT_HEAD_SCL_OP : integer := 3;
constant I2C_STAT_SOM_SDA_IP : integer := 4;
constant I2C_STAT_SOM_SCL_IP : integer := 5;
constant I2C_STAT_SOM_SDA_OP : integer := 6;
constant I2C_STAT_SOM_SCL_OP : integer := 7;
constant I2C_CTRL_HEAD_SCL_FORCE_EN : integer := 0;
constant I2C_CTRL_HEAD_SCL_FORCE_LVL : integer := 1;
subtype I2C_CTRL_HEAD_SCL_DRIVE_HIGH_POWER is integer range 3 downto 2;
constant SIG_SEQ_CTRL_PWR_EN : integer := 0;
constant SIG_SEQ_CTRL_1V1_EN : integer := 1;
constant SIG_SEQ_CTRL_1V2_EN : integer := 2;
@ -157,10 +169,10 @@ package top_pkg is
constant HPS_LOANIO_FAN_PWM : integer := 37;
constant HPS_LOANIO_FAN_SENSE : integer := 54;
constant HPS_LOANIO_APP_SDA : integer := 51;
constant HPS_LOANIO_APP_SCL : integer := 52;
constant HPS_LOANIO_SOM_SDA : integer := 63;
constant HPS_LOANIO_SOM_SCL : integer := 64;
constant HPS_LOANIO_SOM_SDA : integer := 51;
constant HPS_LOANIO_SOM_SCL : integer := 52;
constant HPS_LOANIO_APP_SDA : integer := 63;
constant HPS_LOANIO_APP_SCL : integer := 64;
constant HPS_LOANIO_LED_G : integer := 50;
constant HPS_LOANIO_LED_Y : integer := 55;

View file

@ -0,0 +1,2 @@
V0.07 Adds ability to drive and access 2GB DRAM
V1.0 Add latest inline merge and EPDE FPM7