Skip to content

Commit

Permalink
Merge pull request #81 from pulp-platform/aottaviano/fix-irq-safed
Browse files Browse the repository at this point in the history
Fix host clock and reset in edge propagators for safety island interrupts
  • Loading branch information
alex96295 authored Jul 3, 2023
2 parents 7b4a200 + 71cb8c1 commit 35fa3a0
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions hw/carfield.sv
Original file line number Diff line number Diff line change
Expand Up @@ -187,9 +187,9 @@ logic car_can_intr;
for (genvar i=0; i < 3; i++) begin : gen_sync_adv_timer_intrs
edge_propagator i_sync_adv_timer_intrs (
.clk_tx_i ( periph_clk ),
.rstn_tx_i ( periph_rst_n ),
.rstn_tx_i ( periph_pwr_on_rst_n ),
.edge_i ( car_adv_timer_intrs[i] ),
.clk_rx_i ( host_clk ),
.clk_rx_i ( host_clk_i ),
.rstn_rx_i ( host_pwr_on_rst_n ),
.edge_o ( car_adv_timer_intrs_sync[i] )
);
Expand All @@ -198,9 +198,9 @@ end
for (genvar i=0; i < 3; i++) begin : gen_sync_adv_timer_events
edge_propagator i_sync_adv_timer_events (
.clk_tx_i ( periph_clk ),
.rstn_tx_i ( periph_rst_n ),
.rstn_tx_i ( periph_pwr_on_rst_n ),
.edge_i ( car_adv_timer_events[i] ),
.clk_rx_i ( host_clk ),
.clk_rx_i ( host_clk_i ),
.rstn_rx_i ( host_pwr_on_rst_n ),
.edge_o ( car_adv_timer_events_sync[i] )
);
Expand All @@ -209,18 +209,18 @@ end
// System timer
edge_propagator i_sync_sys_timer_lo_intr (
.clk_tx_i ( periph_clk ),
.rstn_tx_i ( periph_rst_n ),
.rstn_tx_i ( periph_pwr_on_rst_n ),
.edge_i ( car_sys_timer_lo_intr ),
.clk_rx_i ( host_clk ),
.clk_rx_i ( host_clk_i ),
.rstn_rx_i ( host_pwr_on_rst_n ),
.edge_o ( car_sys_timer_lo_intr_sync )
);

edge_propagator i_sync_sys_timer_hi_intr (
.clk_tx_i ( periph_clk ),
.rstn_tx_i ( periph_rst_n ),
.rstn_tx_i ( periph_pwr_on_rst_n ),
.edge_i ( car_sys_timer_hi_intr ),
.clk_rx_i ( host_clk ),
.clk_rx_i ( host_clk_i ),
.rstn_rx_i ( host_pwr_on_rst_n ),
.edge_o ( car_sys_timer_hi_intr_sync )
);
Expand Down Expand Up @@ -1177,8 +1177,8 @@ assign safed_edge_triggered_intrs = safed_intrs_distributed[
// interrupt lines, see `carfield_pkg.sv`). Other interrupt lines are level-triggered.
for (genvar i = 0; i < CarfieldNumTimerIntrs; i++) begin : gen_sync_safed_edge_triggered_intrs
edge_propagator i_sync_safed_edge_triggered_intrs (
.clk_tx_i ( host_clk ),
.rstn_tx_i ( host_rst_n ),
.clk_tx_i ( host_clk_i ),
.rstn_tx_i ( host_pwr_on_rst_n ),
.edge_i ( safed_edge_triggered_intrs[i] ),
.clk_rx_i ( safety_clk ),
.rstn_rx_i ( safety_pwr_on_rst_n ),
Expand All @@ -1195,7 +1195,6 @@ assign safed_intrs = {
safed_intrs_distributed[(NumIntIntrs+CarfieldNumExtIntrs)-1:(EdgeTriggeredIntrsOffset+CarfieldNumTimerIntrs)], // Others up to CarfieldNumExtIntrs
safed_edge_triggered_intrs_sync, // Timer interrupts
safed_intrs_distributed[EdgeTriggeredIntrsOffset-1:(NumIntIntrs+IntClusterNumEoc+NumMailboxesHostd)], // CAN, WDT interrupts
{(NumMailboxesHostd){1'b0}}, // Do not connect cheshire's mailbox interrupts
safed_intrs_distributed[(NumIntIntrs+IntClusterNumEoc)-1:0], // cheshire's peripherals, pulp cluster EOC
// Mailboxes
spatzcl_safed_mbox_intr, // 1
Expand Down

0 comments on commit 35fa3a0

Please sign in to comment.