Skip to content

Commit

Permalink
[top] Hook-up flash/otp control and observation bus to ast
Browse files Browse the repository at this point in the history
Signed-off-by: Timothy Chen <[email protected]>
  • Loading branch information
Timothy Chen committed Feb 20, 2022
1 parent 93d120c commit bef5e3f
Show file tree
Hide file tree
Showing 20 changed files with 361 additions and 28 deletions.
15 changes: 15 additions & 0 deletions hw/ip/flash_ctrl/data/flash_ctrl.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,21 @@
package: "flash_ctrl_pkg"
}

{ struct: "ast_obs_ctrl",
type: "uni",
name: "obs_ctrl",
act: "rcv",
package: "ast_pkg"
}

{ struct: "logic",
type: "uni",
name: "fla_obs",
act: "req",
width: "8",
package: ""
}

],
countermeasures: [
{ name: "BUS.INTEGRITY",
Expand Down
15 changes: 15 additions & 0 deletions hw/ip/flash_ctrl/data/flash_ctrl.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,21 @@
package: "flash_ctrl_pkg"
}

{ struct: "ast_obs_ctrl",
type: "uni",
name: "obs_ctrl",
act: "rcv",
package: "ast_pkg"
}

{ struct: "logic",
type: "uni",
name: "fla_obs",
act: "req",
width: "8",
package: ""
}

],
countermeasures: [
{ name: "BUS.INTEGRITY",
Expand Down
6 changes: 6 additions & 0 deletions hw/ip/flash_ctrl/data/flash_ctrl.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ module flash_ctrl
input prim_alert_pkg::alert_rx_t [flash_ctrl_reg_pkg::NumAlerts-1:0] alert_rx_i,
output prim_alert_pkg::alert_tx_t [flash_ctrl_reg_pkg::NumAlerts-1:0] alert_tx_o,
// Observability
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] fla_obs_o,
// Flash test interface
input scan_en_i,
input prim_mubi_pkg::mubi4_t scanmode_i,
Expand Down Expand Up @@ -1162,6 +1166,8 @@ module flash_ctrl
.flash_ctrl_o (flash_phy_rsp),
.tl_i (prim_tl_i),
.tl_o (prim_tl_o),
.obs_ctrl_i,
.fla_obs_o,
.lc_nvm_debug_en_i,
.flash_bist_enable_i,
.flash_power_down_h_i,
Expand Down
6 changes: 6 additions & 0 deletions hw/ip/flash_ctrl/rtl/flash_ctrl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ module flash_ctrl
input prim_alert_pkg::alert_rx_t [flash_ctrl_reg_pkg::NumAlerts-1:0] alert_rx_i,
output prim_alert_pkg::alert_tx_t [flash_ctrl_reg_pkg::NumAlerts-1:0] alert_tx_o,

// Observability
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] fla_obs_o,

// Flash test interface
input scan_en_i,
input prim_mubi_pkg::mubi4_t scanmode_i,
Expand Down Expand Up @@ -1163,6 +1167,8 @@ module flash_ctrl
.flash_ctrl_o (flash_phy_rsp),
.tl_i (prim_tl_i),
.tl_o (prim_tl_o),
.obs_ctrl_i,
.fla_obs_o,
.lc_nvm_debug_en_i,
.flash_bist_enable_i,
.flash_power_down_h_i,
Expand Down
4 changes: 4 additions & 0 deletions hw/ip/flash_ctrl/rtl/flash_phy.sv
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ module flash_phy
inout flash_test_voltage_h_io,
input prim_mubi_pkg::mubi4_t flash_bist_enable_i,
input lc_ctrl_pkg::lc_tx_t lc_nvm_debug_en_i,
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] fla_obs_o,
output ast_pkg::ast_dif_t flash_alert_o
);

Expand Down Expand Up @@ -302,6 +304,8 @@ module flash_phy
.tms_i(flash_ctrl_i.jtag_req.tms & (lc_nvm_debug_en[FlashLcTmsSel] == lc_ctrl_pkg::On)),
.tdo_o(tdo),
.bist_enable_i(bist_enable_qual),
.obs_ctrl_i,
.fla_obs_o,
.scanmode_i,
.scan_en_i,
.scan_rst_ni,
Expand Down
15 changes: 15 additions & 0 deletions hw/ip/otp_ctrl/data/otp_ctrl.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -897,6 +897,21 @@
default: "'0"
package: "otp_ctrl_part_pkg"
}
// AST observability control
{ struct: "ast_obs_ctrl",
type: "uni",
name: "obs_ctrl",
act: "rcv",
package: "ast_pkg"
}
// prim otp observe bus
{ struct: "logic",
type: "uni",
name: "otp_obs",
act: "req",
width: "8",
package: ""
}
] // inter_signal_list

/////////////////////
Expand Down
15 changes: 15 additions & 0 deletions hw/ip/otp_ctrl/data/otp_ctrl.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,21 @@
default: "'0"
package: "otp_ctrl_part_pkg"
}
// AST observability control
{ struct: "ast_obs_ctrl",
type: "uni",
name: "obs_ctrl",
act: "rcv",
package: "ast_pkg"
}
// prim otp observe bus
{ struct: "logic",
type: "uni",
name: "otp_obs",
act: "req",
width: "8",
package: ""
}
] // inter_signal_list

/////////////////////
Expand Down
6 changes: 6 additions & 0 deletions hw/ip/otp_ctrl/rtl/otp_ctrl.sv
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ module otp_ctrl
// Alerts
input prim_alert_pkg::alert_rx_t [NumAlerts-1:0] alert_rx_i,
output prim_alert_pkg::alert_tx_t [NumAlerts-1:0] alert_tx_o,
// Observability to AST
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] otp_obs_o,
// Macro-specific power sequencing signals to/from AST.
output otp_ast_req_t otp_ast_pwr_seq_o,
input otp_ast_rsp_t otp_ast_pwr_seq_h_i,
Expand Down Expand Up @@ -747,6 +750,9 @@ module otp_ctrl
) u_otp (
.clk_i,
.rst_ni,
// Observability controls to/from AST
.obs_ctrl_i,
.otp_obs_o,
// Power sequencing signals to/from AST
.pwr_seq_o ( otp_ast_pwr_seq_o.pwr_seq ),
.pwr_seq_h_i ( otp_ast_pwr_seq_h_i.pwr_seq_h ),
Expand Down
7 changes: 6 additions & 1 deletion hw/ip/prim_generic/rtl/prim_generic_flash.sv
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ module prim_generic_flash #(
output ast_pkg::ast_dif_t fl_alert_src_o,
input tlul_pkg::tl_h2d_t tl_i,
output tlul_pkg::tl_d2h_t tl_o,
// Observability
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] fla_obs_o,
input devmode_i
);

Expand Down Expand Up @@ -175,7 +178,9 @@ module prim_generic_flash #(
// default alert assignments
assign fl_alert_src_o = '{p: '0, n: '1};


logic unused_obs;
assign unused_obs = |obs_ctrl_i;
assign fla_obs_o = '0;


endmodule // prim_generic_flash
7 changes: 7 additions & 0 deletions hw/ip/prim_generic/rtl/prim_generic_otp.sv
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,9 @@ module prim_generic_otp
) (
input clk_i,
input rst_ni,
// Observability
input ast_pkg::ast_obs_ctrl_t obs_ctrl_i,
output logic [7:0] otp_obs_o,
// Macro-specific power sequencing signals to/from AST
output logic [PwrSeqWidth-1:0] pwr_seq_o,
input [PwrSeqWidth-1:0] pwr_seq_h_i,
Expand Down Expand Up @@ -72,6 +75,10 @@ module prim_generic_otp
assign unused_pwr_seq_h = pwr_seq_h_i;
assign pwr_seq_o = '0;

logic unused_obs;
assign unused_obs = |obs_ctrl_i;
assign otp_obs_o = '0;

wire unused_ext_voltage;
assign unused_ext_voltage = ext_voltage_io;
logic unused_test_ctrl_i;
Expand Down
Loading

0 comments on commit bef5e3f

Please sign in to comment.