From 540d756b3bfa1431323e7c62911732afb9622ee5 Mon Sep 17 00:00:00 2001 From: Michael Rogenmoser Date: Wed, 31 Jul 2024 13:04:57 +0200 Subject: [PATCH] Update instruction cache with injection testing --- Bender.lock | 10 +++--- Bender.yml | 2 +- regression-tests | 2 +- .../pulp_extract_nets.tcl | 36 +++++++++++++++++++ 4 files changed, 43 insertions(+), 7 deletions(-) diff --git a/Bender.lock b/Bender.lock index 714f94b..1d5947b 100644 --- a/Bender.lock +++ b/Bender.lock @@ -7,8 +7,8 @@ packages: dependencies: - common_cells axi: - revision: 9402c8a9ce0a7b5253c3c29e788612d771e8b5d6 - version: 0.39.3 + revision: 587355b77b8ce94dcd600efbd5d5bd118ff913a7 + version: 0.39.4 source: Git: https://github.com/pulp-platform/axi.git dependencies: @@ -38,7 +38,7 @@ packages: dependencies: - common_cells cluster_icache: - revision: 8114ab36fd446f76cd1e9f139f12a62ab1fb9a6a + revision: dd0e8f3497903a9ca99fc9f349d5a4f688ceb3ae version: null source: Git: https://github.com/pulp-platform/cluster_icache.git @@ -63,8 +63,8 @@ packages: dependencies: - hci common_cells: - revision: 0d67563b6b592549542544f1abc0f43e5d4ee8b4 - version: 1.35.0 + revision: c27bce39ebb2e6bae52f60960814a2afca7bd4cb + version: 1.37.0 source: Git: https://github.com/pulp-platform/common_cells.git dependencies: diff --git a/Bender.yml b/Bender.yml index e29fcdd..afda922 100644 --- a/Bender.yml +++ b/Bender.yml @@ -20,7 +20,7 @@ dependencies: mchan: { git: "https://github.com/pulp-platform/mchan.git", rev: 7f064f205a3e0203e959b14773c4afecf56681ab } # branch: yt/fix-parametrization idma: { git: "https://github.com/pulp-platform/iDMA.git", rev: 437ffa9dac5dea0daccfd3e8ae604d4f6ae2cdf1 } # branch: master hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: "2886cb2a46cea3e2bd2d979b505d88fadfbe150c" } # branch: astral - cluster_icache: { git: "https://github.com/pulp-platform/cluster_icache.git", rev: "8114ab36fd446f76cd1e9f139f12a62ab1fb9a6a" } # michaero/branch: astral_cut_path + cluster_icache: { git: "https://github.com/pulp-platform/cluster_icache.git", rev: "dd0e8f3497903a9ca99fc9f349d5a4f688ceb3ae" } # branch: michaero/astral_reliability cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", rev: 0b8e8ab } # branch: fc/hci-v2 axi: { git: "https://github.com/pulp-platform/axi.git", version: 0.39.3 } timer_unit: { git: "https://github.com/pulp-platform/timer_unit.git", version: 1.0.2 } diff --git a/regression-tests b/regression-tests index fc7f5da..78dff04 160000 --- a/regression-tests +++ b/regression-tests @@ -1 +1 @@ -Subproject commit fc7f5da76fc99fd1fa2f10d4a5ce5d8c2c6f3ddd +Subproject commit 78dff04a58d676fe17bc5801b64cd4976b08f737 diff --git a/scripts/fault_injection_utils/pulp_extract_nets.tcl b/scripts/fault_injection_utils/pulp_extract_nets.tcl index d200481..c566fbc 100644 --- a/scripts/fault_injection_utils/pulp_extract_nets.tcl +++ b/scripts/fault_injection_utils/pulp_extract_nets.tcl @@ -245,6 +245,42 @@ proc get_all_core_nets {core} { return $all_signals } +########################## +# Get all icache state # +########################## + +proc get_all_icache_state {} { + set icache_base /pulp_cluster_tb/cluster_i/icache_top_i/i_snitch_icache + + set l1_data_base $icache_base/gen_serial_lookup/i_lookup/i_data/i_tc_sram + set l1_tag_base $icache_base/gen_serial_lookup/i_lookup/gen_scm + + set l1_data [list] + for {set i 0} {$i < [examine -radix dec $l1_data_base/NumWords]} {incr i} { + lappend l1_data $l1_data_base/sram\[$i\] + } + set l1_tag [list] + for {set i 0} {$i < [examine -radix dec $icache_base/SET_COUNT]} {incr i} { + for {set j 0} {$j < [examine -radix dec $l1_tag_base/g_sets\[$i\]/i_tag/N_SCM_REGISTERS]} {incr j} { + lappend l1_tag $l1_tag_base/g_sets\[$i\]/i_tag/block_ram_gen/MemContent_int\[$j\] + } + } + + set l0_data [list] + set l0_tag [list] + for {set i 0} {$i < [examine -radix dec $icache_base/NR_FETCH_PORTS]} {incr i} { + for {set j 0} {$j < [examine -radix dec $icache_base/L0_LINE_COUNT]} {incr j} { + lappend l0_data $icache_base/gen_prefetcher\[$i\]/i_snitch_icache_l0/data\[$j\] + } + # Questa force does not work properly on arrays of structs, always forcing the first element instead of the one specified. + # Therefore, we limit our injections as well. + lappend l0_tag $icache_base/gen_prefetcher\[$i\]/i_snitch_icache_l0/tag\[0\].tag + lappend l0_tag $icache_base/gen_prefetcher\[$i\]/i_snitch_icache_l0/tag\[0\].vld + } + + return [concat $l1_data $l1_tag $l0_data $l0_tag] +} + ################## # Memory signals # ##################