Skip to content

Commit 32f52f4

Browse files
Wire up NIC API status (#397)
I noticed that that `humility dashboard` is never showing us in `A0PlusHP`. It looks like the NIC API status register never changes: ``` nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x0 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x0 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x0 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x2 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x2 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x3 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x4 } } nic_api_status: NicApiStatusDebug { nic_sm: Ok(Idle) }, nic_raw_status: NicRawStatusDebug { hw_sm: 0x6 } } ``` Pattern-matching with nearby code, I think this is the issue! I have added a bug-fix to the IFR flags also reported by matt to this PR. --------- Co-authored-by: Nathanael Huffman <[email protected]>
1 parent d8243b6 commit 32f52f4

File tree

2 files changed

+12
-3
lines changed

2 files changed

+12
-3
lines changed

hdl/projects/cosmo_seq/sequencer/sequencer_regs.vhd

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ entity sequencer_regs is
3030
seq_raw_status : in seq_raw_status_type;
3131
therm_trip : in std_logic;
3232
smerr_assert : in std_logic;
33+
a0_faulted : in std_logic;
3334
-- from nic block
3435
nic_api_status : in nic_api_status_type;
3536
nic_raw_status : in nic_raw_status_type;
@@ -207,10 +208,16 @@ begin
207208
elsif rising_edge(clk) then
208209
ifr.thermtrip <= ifr.thermtrip or (not therm_trip_last and therm_trip);
209210
ifr.smerr_assert <= ifr.smerr_assert or (not smerr_assert_last and smerr_assert);
211+
ifr.amd_rstn_fedge <= ifr.amd_rstn_fedge or amd_reset_l_fedge;
212+
ifr.amd_pwrok_fedge <= ifr.amd_pwrok_fedge or amd_pwrok_fedge;
213+
ifr.a0mapo <= ifr.a0mapo or a0_faulted;
214+
-- TODO: not implemented yet
215+
ifr.nicmapo <= '0';
216+
ifr.fanfault <= '0';
210217

211218
if active_write then
212219
case to_integer(axi_if.write_address.addr) is
213-
when IFR_OFFSET => ifr <= ifr and (not axi_if.write_data.data);
220+
when IFR_OFFSET => ifr <= unpack(axi_if.write_data.data);
214221
when IER_OFFSET => ier <= unpack(axi_if.write_data.data);
215222
when EARLY_POWER_CTRL_OFFSET => early_power_ctrl <= unpack(axi_if.write_data.data);
216223
when POWER_CTRL_OFFSET => power_ctrl <= unpack(axi_if.write_data.data);

hdl/projects/cosmo_seq/sequencer/sp5_sequencer.vhd

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ architecture rtl of sp5_sequencer is
9191
signal nic_overrides : nic_overrides_type;
9292
signal debug_enables : debug_enables_type;
9393
signal smerr_assert : std_logic;
94+
signal a0_faulted : std_logic;
9495

9596

9697

@@ -135,6 +136,7 @@ begin
135136
nic_raw_status => nic_raw_status,
136137
debug_enables => debug_enables,
137138
nic_overrides => nic_overrides,
139+
a0_faulted => a0_faulted,
138140
rails_en_rdbk => rails_en_rdbk,
139141
rails_pg_rdbk => rails_pg_rdbk,
140142
sp5_readbacks => sp5_readbacks,
@@ -234,7 +236,7 @@ begin
234236
smerr_assert => smerr_assert,
235237
a0_ok => a0_ok,
236238
a0_idle => a0_idle,
237-
a0_faulted => open,
239+
a0_faulted => a0_faulted,
238240
sw_enable => power_ctrl.a0_en,
239241
raw_state => seq_raw_status,
240242
api_state => seq_api_status,
@@ -256,7 +258,7 @@ begin
256258
nic_idle => nic_idle,
257259
sw_enable => power_ctrl.a0_en,
258260
raw_state => nic_raw_status,
259-
api_state => open,
261+
api_state => nic_api_status,
260262
upstream_ok => a0_ok,
261263
nic_overrides_reg => nic_overrides,
262264
debug_enables => debug_enables,

0 commit comments

Comments
 (0)