Skip to content

Commit b4d3f12

Browse files
committed
Document wb_acq_core reserved bits that exposes debug information
1 parent 46a86a0 commit b4d3f12

File tree

7 files changed

+659
-332
lines changed

7 files changed

+659
-332
lines changed

modules/wishbone/wb_acq_core/wb_acq_core.vhd

Lines changed: 16 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -443,29 +443,6 @@ architecture rtl of wb_acq_core is
443443
signal dbg_ddr_addr_cnt_axis : std_logic_vector(30 downto 0);
444444
signal dbg_ddr_addr_init : std_logic_vector(30 downto 0);
445445
signal dbg_ddr_addr_max : std_logic_vector(30 downto 0);
446-
------------------------------------------------------------------------------
447-
-- Components
448-
------------------------------------------------------------------------------
449-
450-
component acq_core_regs
451-
port (
452-
rst_n_i : in std_logic;
453-
clk_sys_i : in std_logic;
454-
wb_adr_i : in std_logic_vector(5 downto 0);
455-
wb_dat_i : in std_logic_vector(31 downto 0);
456-
wb_dat_o : out std_logic_vector(31 downto 0);
457-
wb_cyc_i : in std_logic;
458-
wb_sel_i : in std_logic_vector(3 downto 0);
459-
wb_stb_i : in std_logic;
460-
wb_we_i : in std_logic;
461-
wb_ack_o : out std_logic;
462-
wb_stall_o : out std_logic;
463-
fs_clk_i : in std_logic;
464-
ext_clk_i : in std_logic;
465-
regs_i : in t_acq_core_in_registers;
466-
regs_o : out t_acq_core_out_registers
467-
);
468-
end component;
469446

470447
function to_std_logic(arg : boolean) return std_logic is
471448
begin
@@ -542,6 +519,8 @@ begin
542519
wb_we_i => wb_slv_adp_out.we,
543520
wb_ack_o => wb_slv_adp_in.ack,
544521
wb_stall_o => wb_slv_adp_in.stall,
522+
wb_err_o => wb_slv_adp_in.err,
523+
wb_rty_o => wb_slv_adp_in.rty,
545524
fs_clk_i => fs_clk_i,
546525
ext_clk_i => ext_clk_i,
547526
regs_i => regs_in,
@@ -587,13 +566,23 @@ begin
587566

588567
regs_in.sta_fsm_state_i <= acq_fsm_state;
589568
regs_in.sta_fsm_acq_done_i <= acq_end;
590-
regs_in.sta_reserved1_i <= dbg_fifo_rd_empty & dbg_fifo_fc_rd_en & dbg_fifo_re & dbg_fifo_we;
569+
570+
regs_in.sta_fifo_we_i <= dbg_fifo_we;
571+
regs_in.sta_fifo_re_i <= dbg_fifo_re;
572+
regs_in.sta_fifo_fc_rd_en_i <= dbg_fifo_fc_rd_en;
573+
regs_in.sta_fifo_rd_empty_i <= dbg_fifo_rd_empty;
574+
591575
regs_in.sta_fc_trans_done_i <= fifo_fc_all_trans_done_l;
592576
regs_in.sta_fc_full_i <= fifo_sta_full;
593-
regs_in.sta_reserved2_i <= "00" & dbg_source_pl_stall & dbg_source_pl_dreq &
594-
dbg_fifo_fc_valid_fwft & dbg_fifo_wr_full;
577+
578+
regs_in.sta_fifo_wr_full_i <= dbg_fifo_wr_full;
579+
regs_in.sta_fifo_fc_valid_fwft_i <= dbg_fifo_fc_valid_fwft;
580+
regs_in.sta_source_pl_dreq_i <= dbg_source_pl_dreq;
581+
regs_in.sta_source_pl_stall_i <= dbg_source_pl_stall;
582+
regs_in.sta_reserved2_i <= "00";
583+
595584
regs_in.sta_ddr3_trans_done_i <= ddr3_all_trans_done_l;
596-
regs_in.sta_reserved3_i <= f_gen_std_logic_vector(regs_in.sta_reserved3_i'length-
585+
regs_in.sta_fifo_wr_count_i <= f_gen_std_logic_vector(regs_in.sta_fifo_wr_count_i'length-
597586
dbg_fifo_wr_count'length, '0') & dbg_fifo_wr_count;
598587
regs_in.trig_pos_i <= f_gen_std_logic_vector(regs_in.trig_pos_i'length-
599588
ddr_trig_addr'length, '0') & ddr_trig_addr;

modules/wishbone/wb_acq_core/wbgen/acq_core.wb

Lines changed: 78 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,41 @@ peripheral {
102102
};
103103

104104
field {
105-
name = "Reserved";
106-
description = "Ignore on read, write with 0's";
107-
prefix = "reserved1";
105+
name = "FIFO write enable";
106+
description = "FIFO write enable, used for debug only";
107+
prefix = "fifo_we";
108+
type = SLV;
109+
size = 1;
110+
access_bus = READ_ONLY;
111+
access_dev = WRITE_ONLY;
112+
};
113+
114+
field {
115+
name = "FIFO read enable";
116+
description = "FIFO read enable, used for debug only";
117+
prefix = "fifo_re";
118+
type = SLV;
119+
size = 1;
120+
access_bus = READ_ONLY;
121+
access_dev = WRITE_ONLY;
122+
};
123+
124+
field {
125+
name = "FIFO flow control read enable";
126+
description = "FIFO flow control read enable, used for debug only";
127+
prefix = "fifo_fc_rd_en";
128+
type = SLV;
129+
size = 1;
130+
access_bus = READ_ONLY;
131+
access_dev = WRITE_ONLY;
132+
};
133+
134+
field {
135+
name = "FIFO empty";
136+
description = "FIFO empty, used for debug only";
137+
prefix = "fifo_rd_empty";
108138
type = SLV;
109-
size = 4;
139+
size = 1;
110140
access_bus = READ_ONLY;
111141
access_dev = WRITE_ONLY;
112142
};
@@ -134,12 +164,52 @@ peripheral {
134164
access_dev = WRITE_ONLY;
135165
};
136166

167+
field {
168+
name = "FIFO write full";
169+
description = "FIFO write full, used for debug only";
170+
prefix = "fifo_wr_full";
171+
type = SLV;
172+
size = 1;
173+
access_bus = READ_ONLY;
174+
access_dev = WRITE_ONLY;
175+
};
176+
177+
field {
178+
name = "FWFT FIFO valid output";
179+
description = "FWFT FIFO valid output, used for debug only";
180+
prefix = "fifo_fc_valid_fwft";
181+
type = SLV;
182+
size = 1;
183+
access_bus = READ_ONLY;
184+
access_dev = WRITE_ONLY;
185+
};
186+
187+
field {
188+
name = "Flow control data required";
189+
description = "Flow control data required, used for debug only";
190+
prefix = "source_pl_dreq";
191+
type = SLV;
192+
size = 1;
193+
access_bus = READ_ONLY;
194+
access_dev = WRITE_ONLY;
195+
};
196+
197+
field {
198+
name = "Flow control stall";
199+
description = "Flow control stall, used for debug only";
200+
prefix = "source_pl_stall";
201+
type = SLV;
202+
size = 1;
203+
access_bus = READ_ONLY;
204+
access_dev = WRITE_ONLY;
205+
};
206+
137207
field {
138208
name = "Reserved";
139209
description = "Ignore on read, write with 0's";
140210
prefix = "reserved2";
141211
type = SLV;
142-
size = 6;
212+
size = 2;
143213
access_bus = READ_ONLY;
144214
access_dev = WRITE_ONLY;
145215
};
@@ -157,9 +227,9 @@ peripheral {
157227
};
158228

159229
field {
160-
name = "Reserved";
161-
description = "Ignore on read, write with 0's";
162-
prefix = "reserved3";
230+
name = "FIFO write count";
231+
description = "FIFO write count, used for debugging only";
232+
prefix = "fifo_wr_count";
163233
type = SLV;
164234
size = 15;
165235
access_bus = READ_ONLY;

modules/wishbone/wb_acq_core/wbgen/acq_core_regs.vhd

Lines changed: 27 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
---------------------------------------------------------------------------------------
44
-- File : acq_core_regs.vhd
55
-- Author : auto-generated by wbgen2 from acq_core.wb
6-
-- Created : Wed Nov 1 10:46:18 2017
6+
-- Created : Tue Apr 4 13:59:43 2023
77
-- Standard : VHDL'87
88
---------------------------------------------------------------------------------------
99
-- THIS FILE WAS GENERATED BY wbgen2 FROM SOURCE FILE acq_core.wb
@@ -29,6 +29,8 @@ entity acq_core_regs is
2929
wb_stb_i : in std_logic;
3030
wb_we_i : in std_logic;
3131
wb_ack_o : out std_logic;
32+
wb_err_o : out std_logic;
33+
wb_rty_o : out std_logic;
3234
wb_stall_o : out std_logic;
3335
fs_clk_i : in std_logic;
3436
ext_clk_i : in std_logic;
@@ -183,13 +185,8 @@ signal allones : std_logic_vector(31 downto 0);
183185
signal allzeros : std_logic_vector(31 downto 0);
184186

185187
begin
186-
-- Some internal signals assignments. For (foreseen) compatibility with other bus standards.
188+
-- Some internal signals assignments
187189
wrdata_reg <= wb_dat_i;
188-
bwsel_reg <= wb_sel_i;
189-
rd_int <= wb_cyc_i and (wb_stb_i and (not wb_we_i));
190-
wr_int <= wb_cyc_i and (wb_stb_i and wb_we_i);
191-
allones <= (others => '1');
192-
allzeros <= (others => '0');
193190
--
194191
-- Main register bank access process.
195192
process (clk_sys_i, rst_n_i)
@@ -342,12 +339,19 @@ begin
342339
acq_core_sta_fsm_state_lwb_in_progress <= '1';
343340
end if;
344341
rddata_reg(3) <= acq_core_sta_fsm_acq_done_sync1;
345-
rddata_reg(7 downto 4) <= regs_i.sta_reserved1_i;
342+
rddata_reg(4) <= regs_i.sta_fifo_we_i;
343+
rddata_reg(5) <= regs_i.sta_fifo_re_i;
344+
rddata_reg(6) <= regs_i.sta_fifo_fc_rd_en_i;
345+
rddata_reg(7) <= regs_i.sta_fifo_rd_empty_i;
346346
rddata_reg(8) <= acq_core_sta_fc_trans_done_sync1;
347347
rddata_reg(9) <= acq_core_sta_fc_full_sync1;
348-
rddata_reg(15 downto 10) <= regs_i.sta_reserved2_i;
348+
rddata_reg(10) <= regs_i.sta_fifo_wr_full_i;
349+
rddata_reg(11) <= regs_i.sta_fifo_fc_valid_fwft_i;
350+
rddata_reg(12) <= regs_i.sta_source_pl_dreq_i;
351+
rddata_reg(13) <= regs_i.sta_source_pl_stall_i;
352+
rddata_reg(15 downto 14) <= regs_i.sta_reserved2_i;
349353
rddata_reg(16) <= acq_core_sta_ddr3_trans_done_sync1;
350-
rddata_reg(31 downto 17) <= regs_i.sta_reserved3_i;
354+
rddata_reg(31 downto 17) <= regs_i.sta_fifo_wr_count_i;
351355
ack_sreg(5) <= '1';
352356
ack_in_progress <= '1';
353357
when "000010" =>
@@ -961,7 +965,10 @@ begin
961965
end process;
962966

963967

964-
-- Reserved
968+
-- FIFO write enable
969+
-- FIFO read enable
970+
-- FIFO flow control read enable
971+
-- FIFO empty
965972
-- External flow control transfer status
966973
-- synchronizer chain for field : External flow control transfer status (type RO/WO, fs_clk_i -> clk_sys_i)
967974
process (fs_clk_i, rst_n_i)
@@ -990,6 +997,10 @@ begin
990997
end process;
991998

992999

1000+
-- FIFO write full
1001+
-- FWFT FIFO valid output
1002+
-- Flow control data required
1003+
-- Flow control stall
9931004
-- Reserved
9941005
-- DDR3 transfer status
9951006
-- synchronizer chain for field : DDR3 transfer status (type RO/WO, fs_clk_i -> clk_sys_i)
@@ -1005,7 +1016,7 @@ begin
10051016
end process;
10061017

10071018

1008-
-- Reserved
1019+
-- FIFO write count
10091020
-- Hardware trigger selection
10101021
-- synchronizer chain for field : Hardware trigger selection (type RW/RO, clk_sys_i <-> fs_clk_i)
10111022
process (fs_clk_i, rst_n_i)
@@ -1070,8 +1081,8 @@ begin
10701081
end process;
10711082

10721083

1073-
-- Channel selection for internal trigger
1074-
-- asynchronous std_logic_vector register : Channel selection for internal trigger (type RW/RO, fs_clk_i <-> clk_sys_i)
1084+
-- Atom selection for internal trigger (atom within the channel selected by DTRIG_WHICH)
1085+
-- asynchronous std_logic_vector register : Atom selection for internal trigger (atom within the channel selected by DTRIG_WHICH) (type RW/RO, fs_clk_i <-> clk_sys_i)
10751086
process (fs_clk_i, rst_n_i)
10761087
begin
10771088
if (rst_n_i = '0') then
@@ -1459,6 +1470,8 @@ begin
14591470
-- Atom width
14601471
rwaddr_reg <= wb_adr_i;
14611472
wb_stall_o <= (not ack_sreg(0)) and (wb_stb_i and wb_cyc_i);
1473+
wb_err_o <= '0';
1474+
wb_rty_o <= '0';
14621475
-- ACK signal generation. Just pass the LSB of ACK counter.
14631476
wb_ack_o <= ack_sreg(0);
14641477
end syn;

0 commit comments

Comments
 (0)