diff --git a/examples/interrupt_hierarchy/README.md b/examples/interrupt_hierarchy/README.md new file mode 100644 index 0000000..f1fb6e5 --- /dev/null +++ b/examples/interrupt_hierarchy/README.md @@ -0,0 +1,8 @@ +The RDL in `interrupt_hierarchy.rdl` is copied from Section 17.2 of the SystemRDL 2.0 LRM and is meant to show how this "Advanced topic in SystemRDL" looks in compiled form. The former figure below below shows the hierarchy that this RDL will achieve. The latter image shows the block interrupt register. + +**Note that both pictures are copied from the [SystemRDL 2.0 LRM](https://www.accellera.org/images/downloads/standards/systemrdl/SystemRDL_2.0_Jan2018.pdf).** + +![hierarchical_interrupt_structure](images/hierarchical_interrupt_structure.jpg) + +![block_interrupt_example](images/block_interrupt_example.jpg) + diff --git a/examples/interrupt_hierarchy/images/block_interrupt_example.jpg b/examples/interrupt_hierarchy/images/block_interrupt_example.jpg new file mode 100644 index 0000000..5e84c39 Binary files /dev/null and b/examples/interrupt_hierarchy/images/block_interrupt_example.jpg differ diff --git a/examples/interrupt_hierarchy/images/hierarchical_interrupt_structure.jpg b/examples/interrupt_hierarchy/images/hierarchical_interrupt_structure.jpg new file mode 100644 index 0000000..ec95c2c Binary files /dev/null and b/examples/interrupt_hierarchy/images/hierarchical_interrupt_structure.jpg differ diff --git a/examples/interrupt_hierarchy/interrupt_hierarchy.rdl b/examples/interrupt_hierarchy/interrupt_hierarchy.rdl new file mode 100644 index 0000000..6d7b1c2 --- /dev/null +++ b/examples/interrupt_hierarchy/interrupt_hierarchy.rdl @@ -0,0 +1,377 @@ +//------------------------------------------------------------ +// Block Level Interrupt Register +//------------------------------------------------------------ + +reg block_int_r { + name = "Example Block Interrupt Register"; + desc = "This is an example of an IP Block with 3 int events. 2 of these + are non-fatal and the third event multi_bit_ecc_error is fatal"; + + default hw=w; // HW can Set int only + default sw=rw; // SW can clear + default woclr; // Clear is via writing a 1 + + field { + desc = "A Packet with a CRC Error has been received"; + level intr; + } crc_error = 0x0; + + field { + desc = "A Packet with an invalid length has been received"; + level intr; + } len_error = 0x0; + + field { + desc="An uncorrectable multi-bit ECC error has been received"; + level intr; + } multi_bit_ecc_error = 0 ; + + field { + desc="Master who was active when ECC Error Occurred"; + sticky; + } active_ecc_master[7:4] = 0; // Example of multi-bit sticky field + // This field is not an intr +}; // End of Reg: block_int_r + +reg block_int_en_r { + name = "Example Block Interrupt Enable Register"; + desc = "This is an example of an IP Block with 3 int events"; + + default hw=na; // HW can't access the enables + default sw=rw; // SW can control them + + field { + desc = "Enable: A Packet with a CRC Error has been received"; + } crc_error = 0x1; + + field { + desc = "Enable: A Packet with an invalid length has been received"; + } len_error = 0x1; + + field { + desc = "Enable: A multi-bit error has been detected"; + } multi_bit_ecc_error = 0x0; +}; // End of Reg: block_int_en_r + +reg block_halt_en_r { + name = "Example Block Halt Enable Register"; + desc = "This is an example of an IP Block with 3 int events"; + + default hw=na; // HW can't access the enables + default sw=rw; // SW can control them + + field { + desc = "Enable: A Packet with a CRC Error has been received"; + } crc_error = 0x0; // not a fatal error do not halt + + field { + desc = "Enable: A Packet with an invalid length has been received"; + } len_error = 0x0; // not a fatal error do not halt + + field { + desc = "Enable: A Packet with an invalid length has been received"; + } multi_bit_ecc_error = 0x1; // fatal error that will + // cause device to halt +}; // End of Reg: block_halt_en_r + +//------------------------------------------------------------ +// Master Interrupt Status Register +//------------------------------------------------------------ + +reg master_int_r { + name = "Master Interrupt Status Register"; + desc = "This register contains the status of the 4 lower Module interrupts. + Also an interrupt signal (myMasterInt) is generated which is the 'OR' + of the four Module interrupts. A Halt signal is also generated which + represents the bitwise or the masked/enabled halt bits"; + + default nonsticky intr; // Unless we want to have to clear this separately + // from the leaf intr this should be non sticky + + default hw=w; // HW normally won't want to access this but it could + default sw=r; // Software can just read this. It clears the leaf intr's + // to clear this + field { + desc = "An interrupt has occurred with ModuleD. + Software must read the ModuleD Master Interrupt Register + in order to determine the source of the interrupt."; + } module_d_int[3:3] = 0x0; + + field { + desc = "An interrupt has occurred with ModuleC. + Software must read the ModuleC Master Interrupt Register + in order to determine the source of the interrupt."; + } module_c_int[2:2] = 0x0; + + field { + desc = "An interrupt has occurred with ModuleB. + Software must read the ModuleB Interrupt Register + in order to determine the source of the interrupt."; + } module_b_int[1:1] = 0x0; + + field { + desc = "An interrupt has occurred with ModuleA. + Software must read the ModuleA Master Interrupt Register + in order to determine the source of the interrupt."; + } module_a_int[0:0] = 0x0; +}; + +// +// The following is the accompanying enable register. Since the combinatorial +// logic for processing the interrupt is internal to the generated verilog, +// there's no need for an external port - which is realized by assigning "na" +// to the hw attribute of the specific field. This could have been defined as +// a mask register just as easily... +// + +//------------------------------------------------------------ +// Interrupt Enable Register +//------------------------------------------------------------ + +reg master_int_en_r { + name = "Master Interrupt Enable Register"; + desc = "Configurable register used in order to enable the corresponding + interrupts found in myMasterInt register."; + + default hw = na; + default sw = rw; + + field { + desc = "Interrupt enable for ModuleD Interrupts. 1 = enable, 0 = disable"; + } module_d_int_en[3:3] = 0x0; + + field { + desc = "Interrupt enable for ModuleC Interrupts. 1 = enable, 0 = disable"; + } module_c_int_en[2:2] = 0x0; + + field { + desc = "Interrupt enable for ModuleB Interrupts. 1 = enable, 0 = disable"; + } module_b_int_en[1:1] = 0x0; + + field { + desc = "Interrupt enable for ModuleA Interrupts. 1 = enable, 0 = disable"; + } module_a_int_en[0:0] = 0x0; +}; + +//------------------------------------------------------------ +// Halt Enable Register +//------------------------------------------------------------ + +// The halt en is another enable or mask that could be used to generate an +// alternate signal like a halt that represents a fatal error in the system or +// some other event NOTE: It does not have to mean fatal as the name implies +// its just another priority level for interrupts... + +reg master_halt_en_r { + name = "Master Halt Enable Register"; + desc = "Configurable register used in order to enable the corresponding + interrupts found in myMasterInt register."; + + default hw = na; + default sw = rw; + + field { + desc = "Halt enable for ModuleD Interrupts. 1 = enable, 0 = disable"; + } module_d_halt_en[3:3] = 0x0; + + field { + desc = "Halt enable for ModuleC Interrupts. 1 = enable, 0 = disable"; + } module_c_halt_en[2:2] = 0x0; + + field { + desc = "Halt enable for ModuleB Interrupts. 1 = enable, 0 = disable"; + } module_b_halt_en[1:1] = 0x0; + + field { + desc = "Halt enable for ModuelA Interrupts. 1 = enable, 0 = disable"; + } module_a_halt_en[0:0] = 0x0; +}; + +//------------------------------------------------------------ +// Global Interrupt Status Register +//------------------------------------------------------------ + +// This takes the block int which feeds the master int and then distills it +// down one more level so we end up with a single bit intr and single bit halt... + +//------------------------------------------------------------ +// Global Interrupt/Halt Enable Register +//------------------------------------------------------------ +reg final_en_r { + name = "My Final Enable Register"; + desc = "This enable allows all interrupts/halts to be suppressed + with a single bit"; + + default hw = na; + default sw = rw; + + field { + desc = "Global Interrupt Enable. 1 = enable, 0 = disable"; + } global_int_en = 0x0; + + field { + desc = "Global Halt Enable. 1 = enable, 0 = disable"; + } global_halt_en = 0x0; +}; + +reg final_int_r { + name = "My Final Int/Halt Register"; + desc = "This distills a lower level interrupts into a final bit than can be + masked"; + + default sw = r; // sw does not need to clear global_int + // (global_int is of type final_int_r) + // instead it clears itself when all master_int intr + // bits get serviced + + default nonsticky intr; + default hw = w; // w needed since dyn assign below implies interconnect to hw + // global_int.global_int->next = master_int->intr; + + field { + desc = "Global Interrupt"; + } global_int = 0x0; + + field { + desc = "Global Halt"; + } global_halt = 0x0; +}; + +addrmap interrupt_hierarchy { + signal { activelow; async; field_reset;} field_reset_n; + + name = "Sample ASIC Interrupt Registers"; + desc = "This register map is designed how one can use interrupt concepts + effectively in SystemRDL"; + + // Leaf Interrupts + + // Block A Registers + + block_int_r block_a_int; // Instance the Leaf Int Register + block_int_en_r block_a_int_en; // Instance the corresponding Int Enable + // Register + block_halt_en_r block_a_halt_en; // Instance the corresponding halt enable + // register + + // This block connects the int bits to their corresponding + // int enables and halt enables + // + block_a_int.crc_error->enable = block_a_int_en.crc_error; + block_a_int.len_error->enable = block_a_int_en.len_error; + block_a_int.multi_bit_ecc_error->enable = block_a_int_en.multi_bit_ecc_error; + block_a_int.crc_error->haltenable = block_a_halt_en.crc_error; + block_a_int.len_error->haltenable = block_a_halt_en.len_error; + block_a_int.multi_bit_ecc_error->haltenable = block_a_halt_en.multi_bit_ecc_error; + + // Block B Registers + block_int_r block_b_int @0x100; + block_int_en_r block_b_int_en; + block_halt_en_r block_b_halt_en; + + block_b_int.crc_error->enable = block_b_int_en.crc_error; + block_b_int.len_error->enable = block_b_int_en.len_error; + block_b_int.multi_bit_ecc_error->enable = block_b_int_en.multi_bit_ecc_error; + block_b_int.crc_error->haltenable = block_b_halt_en.crc_error; + block_b_int.len_error->haltenable = block_b_halt_en.len_error; + block_b_int.multi_bit_ecc_error->haltenable = block_b_halt_en.multi_bit_ecc_error; + + // Block C Registers + block_int_r block_c_int @0x200; + block_int_en_r block_c_int_en; + block_halt_en_r block_c_halt_en; + + block_c_int.crc_error->enable = block_c_int_en.crc_error; + block_c_int.len_error->enable = block_c_int_en.len_error; + block_c_int.multi_bit_ecc_error->enable = block_c_int_en.multi_bit_ecc_error; + block_c_int.crc_error->haltenable = block_c_halt_en.crc_error; + block_c_int.len_error->haltenable = block_c_halt_en.len_error; + block_c_int.multi_bit_ecc_error->haltenable = block_c_halt_en.multi_bit_ecc_error; + + // Block D Registers + block_int_r block_d_int @0x300; + block_int_en_r block_d_int_en; + block_halt_en_r block_d_halt_en; + + block_d_int.crc_error->enable = block_d_int_en.crc_error; + block_d_int.len_error->enable = block_d_int_en.len_error; + block_d_int.multi_bit_ecc_error->enable = block_d_int_en.multi_bit_ecc_error; + block_d_int.crc_error->haltenable = block_d_halt_en.crc_error; + block_d_int.len_error->haltenable = block_d_halt_en.len_error; + block_d_int.multi_bit_ecc_error->haltenable = block_d_halt_en.multi_bit_ecc_error; + + // + // Master Interrupts + // + + master_int_r master_int @0x01000; + master_int_r master_halt; + master_int_en_r master_int_en; + master_halt_en_r master_halt_en; + + // Associate the INT’s with the EN’s + master_int.module_d_int->enable = master_int_en.module_d_int_en; + master_int.module_c_int->enable = master_int_en.module_c_int_en; + master_int.module_b_int->enable = master_int_en.module_b_int_en; + master_int.module_a_int->enable = master_int_en.module_a_int_en; + + // Associate the HALT’s with the EN’s + master_halt.module_d_int->haltenable = master_halt_en.module_d_halt_en; + master_halt.module_c_int->haltenable = master_halt_en.module_c_halt_en; + master_halt.module_b_int->haltenable = master_halt_en.module_b_halt_en; + master_halt.module_a_int->haltenable = master_halt_en.module_a_halt_en; + + // Now hook the lower level leaf interrupts to the higher level interrupts + + // This connects the Implicit Or from Block A's INT reg after + // masking/enable to the next level up (master) + master_int.module_a_int->next = block_a_int->intr; + + // This connects the Implicit Or from Block B's INT reg after + // masking/enable to the next level up (master) + master_int.module_b_int->next = block_b_int->intr; + + // This connects the Implicit Or from Block C's INT reg after + // masking/enable to the next level up (master) + master_int.module_c_int->next = block_c_int->intr; + + // This connects the Implicit Or from Block D's INT reg after + // masking/enable to the next level up (master) + master_int.module_d_int->next = block_d_int->intr; + + // This connects the Implicit Or from Block A's HALT reg after + // masking/enable to the next level up (master) + master_halt.module_a_int->next = block_a_int->halt; + + // This connects the Implicit Or from Block B's HALT reg after + // masking/enable to the next level up (master) + master_halt.module_b_int->next = block_b_int->halt; + + // This connects the Implicit Or from Block C's HALT reg after + // masking/enable to the next level up (master) + master_halt.module_c_int->next = block_c_int->halt; + + // This connects the Implicit Or from Block D's HALT reg after + // masking/enable to the next level up (master) + master_halt.module_d_int->next = block_d_int->halt; + + final_int_r global_int @0x1010; + // Inst the global int/halt register + + final_en_r global_int_en @0x1014; + // Inst the global int/halt enable register + + global_int.global_int->enable = global_int_en.global_int_en; + // Associate the INT with the EN + + global_int.global_halt->haltenable = global_int_en.global_halt_en; + // Associate the HALT with the EN + + global_int.global_int->next = master_int->intr; + // Take the or of the 4 blocks in the master + // Int and create one final interrupt + + global_int.global_halt->next = master_halt->halt; + // Take the or of the 4 blocks in the master + // Int and create one final halt +}; diff --git a/examples/interrupt_hierarchy/srdl2sv_out/interrupt_hierarchy.sv b/examples/interrupt_hierarchy/srdl2sv_out/interrupt_hierarchy.sv new file mode 100644 index 0000000..806df87 --- /dev/null +++ b/examples/interrupt_hierarchy/srdl2sv_out/interrupt_hierarchy.sv @@ -0,0 +1,2743 @@ +/***************************************************************** + * + * ███████╗██████╗ ██████╗ ██╗ ██████╗ ███████╗██╗ ██╗ + * ██╔════╝██╔══██╗██╔══██╗██║ ╚════██╗██╔════╝██║ ██║ + * ███████╗██████╔╝██║ ██║██║ █████╔╝███████╗██║ ██║ + * ╚════██║██╔══██╗██║ ██║██║ ██╔═══╝ ╚════██║╚██╗ ██╔╝ + * ███████║██║ ██║██████╔╝███████╗███████╗███████║ ╚████╔╝ + * ╚══════╝╚═╝ ╚═╝╚═════╝ ╚══════╝╚══════╝╚══════╝ ╚═══╝ + * + * The present RTL was generated by srdl2sv v0.01. The RTL and all + * templates the RTL is derived from are licensed under the MIT + * license. The license is shown below. + * + * srdl2sv itself is licensed under GPLv3. + * + * Maintainer : Dennis Potter + * Report Bugs: https://git.dennispotter.eu/Dennis/srdl2sv/issues + * + * ===GENERATION INFORMATION====================================== + * + * Generation information: + * - User: : dpotter + * - Time : October 24 2021 23:17:35 + * - Path : /home/dpotter/srdl2sv/examples/interrupt_hierarchy + * - RDL file : ['interrupt_hierarchy.rdl'] + * - Hostname : ArchXPS + * + * RDL include directories: + * - + * + * Commandline arguments to srdl2sv: + * - Ouput Directory : ./srdl2sv_out + * - Stream Log Level : DEBUG + * - File Log Level : NONE + * - Use Real Tabs : False + * - Tab Width : 4 + * - Enums Enabled : True + * - Register Bus Type: amba3ahblite + * - Address width : 32 + * - Byte enables : True + * - Descriptions : {'AddrMap': False, 'RegFile': False, 'Memory': False, 'Register': False, 'Field': False} + * + * ===LICENSE OF INTERRUPT_HIERARCHY.SV===================================== + * + * Copyright 2021 Dennis Potter + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + ****************************************************************/ +module interrupt_hierarchy + import srdl2sv_if_pkg::*; +( + // Resets + input field_reset_n, + + // Inputs + input clk , + input HRESETn , + input [31:0] HADDR , + input HWRITE , + input [2:0] HSIZE , + input [3:0] HPROT , + input [1:0] HTRANS , + input [32-1:0] HWDATA , + input HSEL , + input logic [0:0] block_a_int__crc_error_in , + input logic [0:0] block_a_int__len_error_in , + input logic [0:0] block_a_int__multi_bit_ecc_error_in, + input logic [3:0] block_a_int__active_ecc_master_in , + input logic [0:0] block_b_int__crc_error_in , + input logic [0:0] block_b_int__len_error_in , + input logic [0:0] block_b_int__multi_bit_ecc_error_in, + input logic [3:0] block_b_int__active_ecc_master_in , + input logic [0:0] block_c_int__crc_error_in , + input logic [0:0] block_c_int__len_error_in , + input logic [0:0] block_c_int__multi_bit_ecc_error_in, + input logic [3:0] block_c_int__active_ecc_master_in , + input logic [0:0] block_d_int__crc_error_in , + input logic [0:0] block_d_int__len_error_in , + input logic [0:0] block_d_int__multi_bit_ecc_error_in, + input logic [3:0] block_d_int__active_ecc_master_in , + + // Outputs + output HREADYOUT , + output HRESP , + output [32-1:0] HRDATA , + output logic block_a_int_intr, + output logic block_a_int_halt, + output logic block_b_int_intr, + output logic block_b_int_halt, + output logic block_c_int_intr, + output logic block_c_int_halt, + output logic block_d_int_intr, + output logic block_d_int_halt, + output logic master_int_intr , + output logic master_halt_intr, + output logic master_halt_halt, + output logic global_int_intr , + output logic global_int_halt +); + + +// Internal signals +b2r_t b2r; +r2b_t r2b; + +/******************************************************************* + * AMBA 3 AHB Lite Widget + * ====================== + * Naming conventions + * - r2b.* -> Signals from registers to bus + * - b2r.* -> Signals from bus to registers + * - H* -> Signals as defined in AMBA3 AHB Lite + * specification + * - clk -> Clock that drives registers and the bus + *******************************************************************/ +srdl2sv_amba3ahblite + #(.FLOP_REGISTER_IF (0), + .BUS_BITS (32), + .NO_BYTE_ENABLE (0)) +srdl2sv_amba3ahblite_inst + (// Outputs to internal logic + .b2r, + + // Inputs from internal logic + .r2b, + + // Bus protocol + .HRESETn, + .HCLK (clk), + .HADDR, + .HWRITE, + .HSIZE, + .HPROT, + .HTRANS, + .HWDATA, + .HSEL, + + .HREADYOUT, + .HRESP, + .HRDATA); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_a_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_a_int_active ; +logic block_a_int_sw_wr ; +logic [31:0] block_a_int_data_mux_in ; +logic block_a_int_rdy_mux_in ; +logic block_a_int_err_mux_in ; +logic [0:0] block_a_int__crc_error_q ; +logic [0:0] block_a_int__crc_error_sticky_latch ; +logic [0:0] block_a_int__len_error_q ; +logic [0:0] block_a_int__len_error_sticky_latch ; +logic [0:0] block_a_int__multi_bit_ecc_error_q ; +logic [0:0] block_a_int__multi_bit_ecc_error_sticky_latch; +logic [3:0] block_a_int__active_ecc_master_q ; +logic [3:0] block_a_int__active_ecc_master_sticky_latch; + + +// Register-activation for 'block_a_int' +assign block_a_int_active = b2r.addr == 0; +assign block_a_int_sw_wr = block_a_int_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_a_int[0:0]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int__crc_error_q <= 0; +end +else +begin + if (block_a_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_a_int__crc_error_q[0:0] <= block_a_int__crc_error_q[0:0] & ~b2r.data[0:0]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_a_int__crc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_a_int__crc_error_q[i] <= 1'b1; + end + end + end +end // of block_a_int__crc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_a_int__crc_error_sticky_latch = block_a_int__crc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_a_int[1:1]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int__len_error_q <= 0; +end +else +begin + if (block_a_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_a_int__len_error_q[0:0] <= block_a_int__len_error_q[0:0] & ~b2r.data[1:1]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_a_int__len_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_a_int__len_error_q[i] <= 1'b1; + end + end + end +end // of block_a_int__len_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_a_int__len_error_sticky_latch = block_a_int__len_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_a_int[2:2]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_a_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_a_int__multi_bit_ecc_error_q[0:0] <= block_a_int__multi_bit_ecc_error_q[0:0] & ~b2r.data[2:2]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_a_int__multi_bit_ecc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_a_int__multi_bit_ecc_error_q[i] <= 1'b1; + end + end + end +end // of block_a_int__multi_bit_ecc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_a_int__multi_bit_ecc_error_sticky_latch = block_a_int__multi_bit_ecc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : active_ecc_master (block_a_int[7:4]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'sticky'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int__active_ecc_master_q <= 0; +end +else +begin + if (block_a_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_a_int__active_ecc_master_q[3:0] <= block_a_int__active_ecc_master_q[3:0] & ~b2r.data[7:4]; + end + end + else + if (|block_a_int__active_ecc_master_sticky_latch && !(|block_a_int__active_ecc_master_q)) + begin + // Sticky. Keep value until software clears it + block_a_int__active_ecc_master_q <= block_a_int__active_ecc_master_in; + end +end // of block_a_int__active_ecc_master's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_a_int__active_ecc_master_sticky_latch = block_a_int__active_ecc_master_in; + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign block_a_int_intr = |(block_a_int__crc_error_q & block_a_int_en__crc_error_q) || |(block_a_int__len_error_q & block_a_int_en__len_error_q) || |(block_a_int__multi_bit_ecc_error_q & block_a_int_en__multi_bit_ecc_error_q); + +// Register has at least one interrupt field with halt property set +assign block_a_int_halt = |(block_a_int__crc_error_q & ~block_a_halt_en__crc_error_q) || |(block_a_int__len_error_q & ~block_a_halt_en__len_error_q) || |(block_a_int__multi_bit_ecc_error_q & ~block_a_halt_en__multi_bit_ecc_error_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_a_int_data_mux_in = {{24{1'b0}}, block_a_int__active_ecc_master_q, {1{1'b0}}, block_a_int__multi_bit_ecc_error_q, block_a_int__len_error_q, block_a_int__crc_error_q}; + +// Internal registers are ready immediately +assign block_a_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_a_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_a_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_a_int_en_active ; +logic block_a_int_en_sw_wr ; +logic [31:0] block_a_int_en_data_mux_in ; +logic block_a_int_en_rdy_mux_in ; +logic block_a_int_en_err_mux_in ; +logic [0:0] block_a_int_en__crc_error_q ; +logic [0:0] block_a_int_en__len_error_q ; +logic [0:0] block_a_int_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_a_int_en' +assign block_a_int_en_active = b2r.addr == 4; +assign block_a_int_en_sw_wr = block_a_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_a_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int_en__crc_error_q <= 1; +end +else +begin + if (block_a_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_int_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_a_int_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_a_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int_en__len_error_q <= 1; +end +else +begin + if (block_a_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_int_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_a_int_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_a_int_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_int_en__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_a_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_int_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_a_int_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_a_int_en_data_mux_in = {{29{1'b0}}, block_a_int_en__multi_bit_ecc_error_q, block_a_int_en__len_error_q, block_a_int_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_a_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_a_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_a_halt_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_a_halt_en_active ; +logic block_a_halt_en_sw_wr ; +logic [31:0] block_a_halt_en_data_mux_in ; +logic block_a_halt_en_rdy_mux_in ; +logic block_a_halt_en_err_mux_in ; +logic [0:0] block_a_halt_en__crc_error_q ; +logic [0:0] block_a_halt_en__len_error_q ; +logic [0:0] block_a_halt_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_a_halt_en' +assign block_a_halt_en_active = b2r.addr == 8; +assign block_a_halt_en_sw_wr = block_a_halt_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_a_halt_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_halt_en__crc_error_q <= 0; +end +else +begin + if (block_a_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_halt_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_a_halt_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_a_halt_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_halt_en__len_error_q <= 0; +end +else +begin + if (block_a_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_halt_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_a_halt_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_a_halt_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_a_halt_en__multi_bit_ecc_error_q <= 1; +end +else +begin + if (block_a_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_a_halt_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_a_halt_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_a_halt_en_data_mux_in = {{29{1'b0}}, block_a_halt_en__multi_bit_ecc_error_q, block_a_halt_en__len_error_q, block_a_halt_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_a_halt_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_a_halt_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_b_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_b_int_active ; +logic block_b_int_sw_wr ; +logic [31:0] block_b_int_data_mux_in ; +logic block_b_int_rdy_mux_in ; +logic block_b_int_err_mux_in ; +logic [0:0] block_b_int__crc_error_q ; +logic [0:0] block_b_int__crc_error_sticky_latch ; +logic [0:0] block_b_int__len_error_q ; +logic [0:0] block_b_int__len_error_sticky_latch ; +logic [0:0] block_b_int__multi_bit_ecc_error_q ; +logic [0:0] block_b_int__multi_bit_ecc_error_sticky_latch; +logic [3:0] block_b_int__active_ecc_master_q ; +logic [3:0] block_b_int__active_ecc_master_sticky_latch; + + +// Register-activation for 'block_b_int' +assign block_b_int_active = b2r.addr == 256; +assign block_b_int_sw_wr = block_b_int_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_b_int[0:0]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int__crc_error_q <= 0; +end +else +begin + if (block_b_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_b_int__crc_error_q[0:0] <= block_b_int__crc_error_q[0:0] & ~b2r.data[0:0]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_b_int__crc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_b_int__crc_error_q[i] <= 1'b1; + end + end + end +end // of block_b_int__crc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_b_int__crc_error_sticky_latch = block_b_int__crc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_b_int[1:1]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int__len_error_q <= 0; +end +else +begin + if (block_b_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_b_int__len_error_q[0:0] <= block_b_int__len_error_q[0:0] & ~b2r.data[1:1]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_b_int__len_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_b_int__len_error_q[i] <= 1'b1; + end + end + end +end // of block_b_int__len_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_b_int__len_error_sticky_latch = block_b_int__len_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_b_int[2:2]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_b_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_b_int__multi_bit_ecc_error_q[0:0] <= block_b_int__multi_bit_ecc_error_q[0:0] & ~b2r.data[2:2]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_b_int__multi_bit_ecc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_b_int__multi_bit_ecc_error_q[i] <= 1'b1; + end + end + end +end // of block_b_int__multi_bit_ecc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_b_int__multi_bit_ecc_error_sticky_latch = block_b_int__multi_bit_ecc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : active_ecc_master (block_b_int[7:4]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'sticky'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int__active_ecc_master_q <= 0; +end +else +begin + if (block_b_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_b_int__active_ecc_master_q[3:0] <= block_b_int__active_ecc_master_q[3:0] & ~b2r.data[7:4]; + end + end + else + if (|block_b_int__active_ecc_master_sticky_latch && !(|block_b_int__active_ecc_master_q)) + begin + // Sticky. Keep value until software clears it + block_b_int__active_ecc_master_q <= block_b_int__active_ecc_master_in; + end +end // of block_b_int__active_ecc_master's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_b_int__active_ecc_master_sticky_latch = block_b_int__active_ecc_master_in; + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign block_b_int_intr = |(block_b_int__crc_error_q & block_b_int_en__crc_error_q) || |(block_b_int__len_error_q & block_b_int_en__len_error_q) || |(block_b_int__multi_bit_ecc_error_q & block_b_int_en__multi_bit_ecc_error_q); + +// Register has at least one interrupt field with halt property set +assign block_b_int_halt = |(block_b_int__crc_error_q & ~block_b_halt_en__crc_error_q) || |(block_b_int__len_error_q & ~block_b_halt_en__len_error_q) || |(block_b_int__multi_bit_ecc_error_q & ~block_b_halt_en__multi_bit_ecc_error_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_b_int_data_mux_in = {{24{1'b0}}, block_b_int__active_ecc_master_q, {1{1'b0}}, block_b_int__multi_bit_ecc_error_q, block_b_int__len_error_q, block_b_int__crc_error_q}; + +// Internal registers are ready immediately +assign block_b_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_b_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_b_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_b_int_en_active ; +logic block_b_int_en_sw_wr ; +logic [31:0] block_b_int_en_data_mux_in ; +logic block_b_int_en_rdy_mux_in ; +logic block_b_int_en_err_mux_in ; +logic [0:0] block_b_int_en__crc_error_q ; +logic [0:0] block_b_int_en__len_error_q ; +logic [0:0] block_b_int_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_b_int_en' +assign block_b_int_en_active = b2r.addr == 260; +assign block_b_int_en_sw_wr = block_b_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_b_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int_en__crc_error_q <= 1; +end +else +begin + if (block_b_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_int_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_b_int_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_b_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int_en__len_error_q <= 1; +end +else +begin + if (block_b_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_int_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_b_int_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_b_int_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_int_en__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_b_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_int_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_b_int_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_b_int_en_data_mux_in = {{29{1'b0}}, block_b_int_en__multi_bit_ecc_error_q, block_b_int_en__len_error_q, block_b_int_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_b_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_b_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_b_halt_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_b_halt_en_active ; +logic block_b_halt_en_sw_wr ; +logic [31:0] block_b_halt_en_data_mux_in ; +logic block_b_halt_en_rdy_mux_in ; +logic block_b_halt_en_err_mux_in ; +logic [0:0] block_b_halt_en__crc_error_q ; +logic [0:0] block_b_halt_en__len_error_q ; +logic [0:0] block_b_halt_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_b_halt_en' +assign block_b_halt_en_active = b2r.addr == 264; +assign block_b_halt_en_sw_wr = block_b_halt_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_b_halt_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_halt_en__crc_error_q <= 0; +end +else +begin + if (block_b_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_halt_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_b_halt_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_b_halt_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_halt_en__len_error_q <= 0; +end +else +begin + if (block_b_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_halt_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_b_halt_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_b_halt_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_b_halt_en__multi_bit_ecc_error_q <= 1; +end +else +begin + if (block_b_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_b_halt_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_b_halt_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_b_halt_en_data_mux_in = {{29{1'b0}}, block_b_halt_en__multi_bit_ecc_error_q, block_b_halt_en__len_error_q, block_b_halt_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_b_halt_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_b_halt_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_c_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_c_int_active ; +logic block_c_int_sw_wr ; +logic [31:0] block_c_int_data_mux_in ; +logic block_c_int_rdy_mux_in ; +logic block_c_int_err_mux_in ; +logic [0:0] block_c_int__crc_error_q ; +logic [0:0] block_c_int__crc_error_sticky_latch ; +logic [0:0] block_c_int__len_error_q ; +logic [0:0] block_c_int__len_error_sticky_latch ; +logic [0:0] block_c_int__multi_bit_ecc_error_q ; +logic [0:0] block_c_int__multi_bit_ecc_error_sticky_latch; +logic [3:0] block_c_int__active_ecc_master_q ; +logic [3:0] block_c_int__active_ecc_master_sticky_latch; + + +// Register-activation for 'block_c_int' +assign block_c_int_active = b2r.addr == 512; +assign block_c_int_sw_wr = block_c_int_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_c_int[0:0]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int__crc_error_q <= 0; +end +else +begin + if (block_c_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_c_int__crc_error_q[0:0] <= block_c_int__crc_error_q[0:0] & ~b2r.data[0:0]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_c_int__crc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_c_int__crc_error_q[i] <= 1'b1; + end + end + end +end // of block_c_int__crc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_c_int__crc_error_sticky_latch = block_c_int__crc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_c_int[1:1]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int__len_error_q <= 0; +end +else +begin + if (block_c_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_c_int__len_error_q[0:0] <= block_c_int__len_error_q[0:0] & ~b2r.data[1:1]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_c_int__len_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_c_int__len_error_q[i] <= 1'b1; + end + end + end +end // of block_c_int__len_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_c_int__len_error_sticky_latch = block_c_int__len_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_c_int[2:2]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_c_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_c_int__multi_bit_ecc_error_q[0:0] <= block_c_int__multi_bit_ecc_error_q[0:0] & ~b2r.data[2:2]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_c_int__multi_bit_ecc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_c_int__multi_bit_ecc_error_q[i] <= 1'b1; + end + end + end +end // of block_c_int__multi_bit_ecc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_c_int__multi_bit_ecc_error_sticky_latch = block_c_int__multi_bit_ecc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : active_ecc_master (block_c_int[7:4]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'sticky'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int__active_ecc_master_q <= 0; +end +else +begin + if (block_c_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_c_int__active_ecc_master_q[3:0] <= block_c_int__active_ecc_master_q[3:0] & ~b2r.data[7:4]; + end + end + else + if (|block_c_int__active_ecc_master_sticky_latch && !(|block_c_int__active_ecc_master_q)) + begin + // Sticky. Keep value until software clears it + block_c_int__active_ecc_master_q <= block_c_int__active_ecc_master_in; + end +end // of block_c_int__active_ecc_master's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_c_int__active_ecc_master_sticky_latch = block_c_int__active_ecc_master_in; + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign block_c_int_intr = |(block_c_int__crc_error_q & block_c_int_en__crc_error_q) || |(block_c_int__len_error_q & block_c_int_en__len_error_q) || |(block_c_int__multi_bit_ecc_error_q & block_c_int_en__multi_bit_ecc_error_q); + +// Register has at least one interrupt field with halt property set +assign block_c_int_halt = |(block_c_int__crc_error_q & ~block_c_halt_en__crc_error_q) || |(block_c_int__len_error_q & ~block_c_halt_en__len_error_q) || |(block_c_int__multi_bit_ecc_error_q & ~block_c_halt_en__multi_bit_ecc_error_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_c_int_data_mux_in = {{24{1'b0}}, block_c_int__active_ecc_master_q, {1{1'b0}}, block_c_int__multi_bit_ecc_error_q, block_c_int__len_error_q, block_c_int__crc_error_q}; + +// Internal registers are ready immediately +assign block_c_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_c_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_c_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_c_int_en_active ; +logic block_c_int_en_sw_wr ; +logic [31:0] block_c_int_en_data_mux_in ; +logic block_c_int_en_rdy_mux_in ; +logic block_c_int_en_err_mux_in ; +logic [0:0] block_c_int_en__crc_error_q ; +logic [0:0] block_c_int_en__len_error_q ; +logic [0:0] block_c_int_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_c_int_en' +assign block_c_int_en_active = b2r.addr == 516; +assign block_c_int_en_sw_wr = block_c_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_c_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int_en__crc_error_q <= 1; +end +else +begin + if (block_c_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_int_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_c_int_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_c_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int_en__len_error_q <= 1; +end +else +begin + if (block_c_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_int_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_c_int_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_c_int_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_int_en__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_c_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_int_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_c_int_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_c_int_en_data_mux_in = {{29{1'b0}}, block_c_int_en__multi_bit_ecc_error_q, block_c_int_en__len_error_q, block_c_int_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_c_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_c_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_c_halt_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_c_halt_en_active ; +logic block_c_halt_en_sw_wr ; +logic [31:0] block_c_halt_en_data_mux_in ; +logic block_c_halt_en_rdy_mux_in ; +logic block_c_halt_en_err_mux_in ; +logic [0:0] block_c_halt_en__crc_error_q ; +logic [0:0] block_c_halt_en__len_error_q ; +logic [0:0] block_c_halt_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_c_halt_en' +assign block_c_halt_en_active = b2r.addr == 520; +assign block_c_halt_en_sw_wr = block_c_halt_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_c_halt_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_halt_en__crc_error_q <= 0; +end +else +begin + if (block_c_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_halt_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_c_halt_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_c_halt_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_halt_en__len_error_q <= 0; +end +else +begin + if (block_c_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_halt_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_c_halt_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_c_halt_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_c_halt_en__multi_bit_ecc_error_q <= 1; +end +else +begin + if (block_c_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_c_halt_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_c_halt_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_c_halt_en_data_mux_in = {{29{1'b0}}, block_c_halt_en__multi_bit_ecc_error_q, block_c_halt_en__len_error_q, block_c_halt_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_c_halt_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_c_halt_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_d_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_d_int_active ; +logic block_d_int_sw_wr ; +logic [31:0] block_d_int_data_mux_in ; +logic block_d_int_rdy_mux_in ; +logic block_d_int_err_mux_in ; +logic [0:0] block_d_int__crc_error_q ; +logic [0:0] block_d_int__crc_error_sticky_latch ; +logic [0:0] block_d_int__len_error_q ; +logic [0:0] block_d_int__len_error_sticky_latch ; +logic [0:0] block_d_int__multi_bit_ecc_error_q ; +logic [0:0] block_d_int__multi_bit_ecc_error_sticky_latch; +logic [3:0] block_d_int__active_ecc_master_q ; +logic [3:0] block_d_int__active_ecc_master_sticky_latch; + + +// Register-activation for 'block_d_int' +assign block_d_int_active = b2r.addr == 768; +assign block_d_int_sw_wr = block_d_int_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_d_int[0:0]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int__crc_error_q <= 0; +end +else +begin + if (block_d_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_d_int__crc_error_q[0:0] <= block_d_int__crc_error_q[0:0] & ~b2r.data[0:0]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_d_int__crc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_d_int__crc_error_q[i] <= 1'b1; + end + end + end +end // of block_d_int__crc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_d_int__crc_error_sticky_latch = block_d_int__crc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_d_int[1:1]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int__len_error_q <= 0; +end +else +begin + if (block_d_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_d_int__len_error_q[0:0] <= block_d_int__len_error_q[0:0] & ~b2r.data[1:1]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_d_int__len_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_d_int__len_error_q[i] <= 1'b1; + end + end + end +end // of block_d_int__len_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_d_int__len_error_sticky_latch = block_d_int__len_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_d_int[2:2]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'intr', 'intr type', 'enable', 'haltenable'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_d_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_d_int__multi_bit_ecc_error_q[0:0] <= block_d_int__multi_bit_ecc_error_q[0:0] & ~b2r.data[2:2]; + end + end + else + begin + for (int i = 0; i < 1; i++) + begin + if (block_d_int__multi_bit_ecc_error_sticky_latch[i]) + begin + // Stickybit. Keep value until software clears it + block_d_int__multi_bit_ecc_error_q[i] <= 1'b1; + end + end + end +end // of block_d_int__multi_bit_ecc_error's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_d_int__multi_bit_ecc_error_sticky_latch = block_d_int__multi_bit_ecc_error_in; + + + +//-----------------FIELD SUMMARY----------------- +// name : active_ecc_master (block_d_int[7:4]) +// access : hw = w +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'woclr', 'desc', 'sticky'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int__active_ecc_master_q <= 0; +end +else +begin + if (block_d_int_sw_wr) + begin + if (b2r.byte_en[0]) // woclr property + begin + block_d_int__active_ecc_master_q[3:0] <= block_d_int__active_ecc_master_q[3:0] & ~b2r.data[7:4]; + end + end + else + if (|block_d_int__active_ecc_master_sticky_latch && !(|block_d_int__active_ecc_master_q)) + begin + // Sticky. Keep value until software clears it + block_d_int__active_ecc_master_q <= block_d_int__active_ecc_master_in; + end +end // of block_d_int__active_ecc_master's always_ff + +// Define signal that causes the interrupt to be set (level-type interrupt) +assign block_d_int__active_ecc_master_sticky_latch = block_d_int__active_ecc_master_in; + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign block_d_int_intr = |(block_d_int__crc_error_q & block_d_int_en__crc_error_q) || |(block_d_int__len_error_q & block_d_int_en__len_error_q) || |(block_d_int__multi_bit_ecc_error_q & block_d_int_en__multi_bit_ecc_error_q); + +// Register has at least one interrupt field with halt property set +assign block_d_int_halt = |(block_d_int__crc_error_q & ~block_d_halt_en__crc_error_q) || |(block_d_int__len_error_q & ~block_d_halt_en__len_error_q) || |(block_d_int__multi_bit_ecc_error_q & ~block_d_halt_en__multi_bit_ecc_error_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_d_int_data_mux_in = {{24{1'b0}}, block_d_int__active_ecc_master_q, {1{1'b0}}, block_d_int__multi_bit_ecc_error_q, block_d_int__len_error_q, block_d_int__crc_error_q}; + +// Internal registers are ready immediately +assign block_d_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_d_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_d_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_d_int_en_active ; +logic block_d_int_en_sw_wr ; +logic [31:0] block_d_int_en_data_mux_in ; +logic block_d_int_en_rdy_mux_in ; +logic block_d_int_en_err_mux_in ; +logic [0:0] block_d_int_en__crc_error_q ; +logic [0:0] block_d_int_en__len_error_q ; +logic [0:0] block_d_int_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_d_int_en' +assign block_d_int_en_active = b2r.addr == 772; +assign block_d_int_en_sw_wr = block_d_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_d_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int_en__crc_error_q <= 1; +end +else +begin + if (block_d_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_int_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_d_int_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_d_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int_en__len_error_q <= 1; +end +else +begin + if (block_d_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_int_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_d_int_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_d_int_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_int_en__multi_bit_ecc_error_q <= 0; +end +else +begin + if (block_d_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_int_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_d_int_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_d_int_en_data_mux_in = {{29{1'b0}}, block_d_int_en__multi_bit_ecc_error_q, block_d_int_en__len_error_q, block_d_int_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_d_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_d_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : block_d_halt_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic block_d_halt_en_active ; +logic block_d_halt_en_sw_wr ; +logic [31:0] block_d_halt_en_data_mux_in ; +logic block_d_halt_en_rdy_mux_in ; +logic block_d_halt_en_err_mux_in ; +logic [0:0] block_d_halt_en__crc_error_q ; +logic [0:0] block_d_halt_en__len_error_q ; +logic [0:0] block_d_halt_en__multi_bit_ecc_error_q; + + +// Register-activation for 'block_d_halt_en' +assign block_d_halt_en_active = b2r.addr == 776; +assign block_d_halt_en_sw_wr = block_d_halt_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : crc_error (block_d_halt_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_halt_en__crc_error_q <= 0; +end +else +begin + if (block_d_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_halt_en__crc_error_q[0:0] <= b2r.data[0:0]; + end +end // of block_d_halt_en__crc_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : len_error (block_d_halt_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_halt_en__len_error_q <= 0; +end +else +begin + if (block_d_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_halt_en__len_error_q[0:0] <= b2r.data[1:1]; + end +end // of block_d_halt_en__len_error's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : multi_bit_ecc_error (block_d_halt_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + block_d_halt_en__multi_bit_ecc_error_q <= 1; +end +else +begin + if (block_d_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + block_d_halt_en__multi_bit_ecc_error_q[0:0] <= b2r.data[2:2]; + end +end // of block_d_halt_en__multi_bit_ecc_error's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign block_d_halt_en_data_mux_in = {{29{1'b0}}, block_d_halt_en__multi_bit_ecc_error_q, block_d_halt_en__len_error_q, block_d_halt_en__crc_error_q}; + +// Internal registers are ready immediately +assign block_d_halt_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign block_d_halt_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : master_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic master_int_active ; +logic [31:0] master_int_data_mux_in ; +logic master_int_rdy_mux_in ; +logic master_int_err_mux_in ; +logic [0:0] master_int__module_a_int_q; +logic [0:0] master_int__module_b_int_q; +logic [0:0] master_int__module_c_int_q; +logic [0:0] master_int__module_d_int_q; + + +// Register-activation for 'master_int' +assign master_int_active = b2r.addr == 4096; + +//-----------------FIELD SUMMARY----------------- +// name : module_a_int (master_int[0:0]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'enable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int__module_a_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_int__module_a_int_q <= block_a_int_intr; + end +end // of master_int__module_a_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_b_int (master_int[1:1]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'enable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int__module_b_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_int__module_b_int_q <= block_b_int_intr; + end +end // of master_int__module_b_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_c_int (master_int[2:2]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'enable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int__module_c_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_int__module_c_int_q <= block_c_int_intr; + end +end // of master_int__module_c_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_d_int (master_int[3:3]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'enable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int__module_d_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_int__module_d_int_q <= block_d_int_intr; + end +end // of master_int__module_d_int's always_ff + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign master_int_intr = |(master_int__module_a_int_q & master_int_en__module_a_int_en_q) || |(master_int__module_b_int_q & master_int_en__module_b_int_en_q) || |(master_int__module_c_int_q & master_int_en__module_c_int_en_q) || |(master_int__module_d_int_q & master_int_en__module_d_int_en_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign master_int_data_mux_in = {{28{1'b0}}, master_int__module_d_int_q, master_int__module_c_int_q, master_int__module_b_int_q, master_int__module_a_int_q}; + +// Internal registers are ready immediately +assign master_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign master_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (1'b0))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : master_halt +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic master_halt_active ; +logic [31:0] master_halt_data_mux_in ; +logic master_halt_rdy_mux_in ; +logic master_halt_err_mux_in ; +logic [0:0] master_halt__module_a_int_q; +logic [0:0] master_halt__module_b_int_q; +logic [0:0] master_halt__module_c_int_q; +logic [0:0] master_halt__module_d_int_q; + + +// Register-activation for 'master_halt' +assign master_halt_active = b2r.addr == 4100; + +//-----------------FIELD SUMMARY----------------- +// name : module_a_int (master_halt[0:0]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'haltenable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt__module_a_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_halt__module_a_int_q <= block_a_int_halt; + end +end // of master_halt__module_a_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_b_int (master_halt[1:1]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'haltenable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt__module_b_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_halt__module_b_int_q <= block_b_int_halt; + end +end // of master_halt__module_b_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_c_int (master_halt[2:2]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'haltenable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt__module_c_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_halt__module_c_int_q <= block_c_int_halt; + end +end // of master_halt__module_c_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_d_int (master_halt[3:3]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['intr', 'stickybit', 'sw', 'desc', 'haltenable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt__module_d_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + master_halt__module_d_int_q <= block_d_int_halt; + end +end // of master_halt__module_d_int's always_ff + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign master_halt_intr = |(master_halt__module_a_int_q) || |(master_halt__module_b_int_q) || |(master_halt__module_c_int_q) || |(master_halt__module_d_int_q); + +// Register has at least one interrupt field with halt property set +assign master_halt_halt = |(master_halt__module_a_int_q & ~master_halt_en__module_a_halt_en_q) || |(master_halt__module_b_int_q & ~master_halt_en__module_b_halt_en_q) || |(master_halt__module_c_int_q & ~master_halt_en__module_c_halt_en_q) || |(master_halt__module_d_int_q & ~master_halt_en__module_d_halt_en_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign master_halt_data_mux_in = {{28{1'b0}}, master_halt__module_d_int_q, master_halt__module_c_int_q, master_halt__module_b_int_q, master_halt__module_a_int_q}; + +// Internal registers are ready immediately +assign master_halt_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign master_halt_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (1'b0))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : master_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic master_int_en_active ; +logic master_int_en_sw_wr ; +logic [31:0] master_int_en_data_mux_in ; +logic master_int_en_rdy_mux_in ; +logic master_int_en_err_mux_in ; +logic [0:0] master_int_en__module_a_int_en_q; +logic [0:0] master_int_en__module_b_int_en_q; +logic [0:0] master_int_en__module_c_int_en_q; +logic [0:0] master_int_en__module_d_int_en_q; + + +// Register-activation for 'master_int_en' +assign master_int_en_active = b2r.addr == 4104; +assign master_int_en_sw_wr = master_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : module_a_int_en (master_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int_en__module_a_int_en_q <= 0; +end +else +begin + if (master_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_int_en__module_a_int_en_q[0:0] <= b2r.data[0:0]; + end +end // of master_int_en__module_a_int_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_b_int_en (master_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int_en__module_b_int_en_q <= 0; +end +else +begin + if (master_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_int_en__module_b_int_en_q[0:0] <= b2r.data[1:1]; + end +end // of master_int_en__module_b_int_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_c_int_en (master_int_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int_en__module_c_int_en_q <= 0; +end +else +begin + if (master_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_int_en__module_c_int_en_q[0:0] <= b2r.data[2:2]; + end +end // of master_int_en__module_c_int_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_d_int_en (master_int_en[3:3]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_int_en__module_d_int_en_q <= 0; +end +else +begin + if (master_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_int_en__module_d_int_en_q[0:0] <= b2r.data[3:3]; + end +end // of master_int_en__module_d_int_en's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign master_int_en_data_mux_in = {{28{1'b0}}, master_int_en__module_d_int_en_q, master_int_en__module_c_int_en_q, master_int_en__module_b_int_en_q, master_int_en__module_a_int_en_q}; + +// Internal registers are ready immediately +assign master_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign master_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : master_halt_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic master_halt_en_active ; +logic master_halt_en_sw_wr ; +logic [31:0] master_halt_en_data_mux_in ; +logic master_halt_en_rdy_mux_in ; +logic master_halt_en_err_mux_in ; +logic [0:0] master_halt_en__module_a_halt_en_q; +logic [0:0] master_halt_en__module_b_halt_en_q; +logic [0:0] master_halt_en__module_c_halt_en_q; +logic [0:0] master_halt_en__module_d_halt_en_q; + + +// Register-activation for 'master_halt_en' +assign master_halt_en_active = b2r.addr == 4108; +assign master_halt_en_sw_wr = master_halt_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : module_a_halt_en (master_halt_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt_en__module_a_halt_en_q <= 0; +end +else +begin + if (master_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_halt_en__module_a_halt_en_q[0:0] <= b2r.data[0:0]; + end +end // of master_halt_en__module_a_halt_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_b_halt_en (master_halt_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt_en__module_b_halt_en_q <= 0; +end +else +begin + if (master_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_halt_en__module_b_halt_en_q[0:0] <= b2r.data[1:1]; + end +end // of master_halt_en__module_b_halt_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_c_halt_en (master_halt_en[2:2]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt_en__module_c_halt_en_q <= 0; +end +else +begin + if (master_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_halt_en__module_c_halt_en_q[0:0] <= b2r.data[2:2]; + end +end // of master_halt_en__module_c_halt_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : module_d_halt_en (master_halt_en[3:3]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + master_halt_en__module_d_halt_en_q <= 0; +end +else +begin + if (master_halt_en_sw_wr) + begin + if (b2r.byte_en[0]) + master_halt_en__module_d_halt_en_q[0:0] <= b2r.data[3:3]; + end +end // of master_halt_en__module_d_halt_en's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign master_halt_en_data_mux_in = {{28{1'b0}}, master_halt_en__module_d_halt_en_q, master_halt_en__module_c_halt_en_q, master_halt_en__module_b_halt_en_q, master_halt_en__module_a_halt_en_q}; + +// Internal registers are ready immediately +assign master_halt_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign master_halt_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : global_int +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic global_int_active ; +logic [31:0] global_int_data_mux_in ; +logic global_int_rdy_mux_in ; +logic global_int_err_mux_in ; +logic [0:0] global_int__global_int_q ; +logic [0:0] global_int__global_halt_q; + + +// Register-activation for 'global_int' +assign global_int_active = b2r.addr == 4112; + +//-----------------FIELD SUMMARY----------------- +// name : global_int (global_int[0:0]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'intr', 'stickybit', 'desc', 'enable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + global_int__global_int_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + global_int__global_int_q <= master_int_intr; + end +end // of global_int__global_int's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : global_halt (global_int[1:1]) +// access : hw = w +// sw = r (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'intr', 'stickybit', 'desc', 'haltenable', 'next'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + global_int__global_halt_q <= 0; +end +else +begin + begin + // Non-sticky interrupt. Only keep value high if source keeps up + global_int__global_halt_q <= master_halt_halt; + end +end // of global_int__global_halt's always_ff + + +/************************************** + * Register contains interrupts * + **************************************/ +// Register has at least one interrupt field +assign global_int_intr = |(global_int__global_int_q & global_int_en__global_int_en_q) || |(global_int__global_halt_q); + +// Register has at least one interrupt field with halt property set +assign global_int_halt = |(global_int__global_int_q) || |(global_int__global_halt_q & ~global_int_en__global_halt_en_q); + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign global_int_data_mux_in = {{30{1'b0}}, global_int__global_halt_q, global_int__global_int_q}; + +// Internal registers are ready immediately +assign global_int_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign global_int_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (1'b0))); + +/******************************************************************* +/******************************************************************* +/* REGISTER : global_int_en +/* DIMENSION : 0 +/* DEPTHS (per dimension): [] +/******************************************************************* +/*******************************************************************/ + +logic global_int_en_active ; +logic global_int_en_sw_wr ; +logic [31:0] global_int_en_data_mux_in ; +logic global_int_en_rdy_mux_in ; +logic global_int_en_err_mux_in ; +logic [0:0] global_int_en__global_int_en_q ; +logic [0:0] global_int_en__global_halt_en_q; + + +// Register-activation for 'global_int_en' +assign global_int_en_active = b2r.addr == 4116; +assign global_int_en_sw_wr = global_int_en_active && b2r.w_vld; + +//-----------------FIELD SUMMARY----------------- +// name : global_int_en (global_int_en[0:0]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + global_int_en__global_int_en_q <= 0; +end +else +begin + if (global_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + global_int_en__global_int_en_q[0:0] <= b2r.data[0:0]; + end +end // of global_int_en__global_int_en's always_ff + + + +//-----------------FIELD SUMMARY----------------- +// name : global_halt_en (global_int_en[1:1]) +// access : hw = na +// sw = rw (precedence) +// reset : active_low / asynchronous +// flags : ['sw', 'desc'] +// external : False +//----------------------------------------------- + +always_ff @(posedge clk or negedge field_reset_n) +if (!field_reset_n) +begin + global_int_en__global_halt_en_q <= 0; +end +else +begin + if (global_int_en_sw_wr) + begin + if (b2r.byte_en[0]) + global_int_en__global_halt_en_q[0:0] <= b2r.data[1:1]; + end +end // of global_int_en__global_halt_en's always_ff + + + + +/************************************** + * Assign all fields to signal to Mux * + **************************************/ +// Assign all fields. Fields that are not readable are tied to 0. +assign global_int_en_data_mux_in = {{30{1'b0}}, global_int_en__global_halt_en_q, global_int_en__global_int_en_q}; + +// Internal registers are ready immediately +assign global_int_en_rdy_mux_in = 1'b1; + +// Return an error if *no* read and *no* write was succesful. If some bits +// cannot be read/written but others are succesful, don't return and error +// Hence, as long as one action can be succesful, no error will be returned. +assign global_int_en_err_mux_in = !((b2r.r_vld && (b2r.byte_en[0])) || (b2r.w_vld && (b2r.byte_en[0]))); + +// Read multiplexer +always_comb +begin + unique case (1'b1) + block_a_int_active: + begin + r2b.data = block_a_int_data_mux_in; + r2b.err = block_a_int_err_mux_in; + r2b.rdy = block_a_int_rdy_mux_in; + end + block_a_int_en_active: + begin + r2b.data = block_a_int_en_data_mux_in; + r2b.err = block_a_int_en_err_mux_in; + r2b.rdy = block_a_int_en_rdy_mux_in; + end + block_a_halt_en_active: + begin + r2b.data = block_a_halt_en_data_mux_in; + r2b.err = block_a_halt_en_err_mux_in; + r2b.rdy = block_a_halt_en_rdy_mux_in; + end + block_b_int_active: + begin + r2b.data = block_b_int_data_mux_in; + r2b.err = block_b_int_err_mux_in; + r2b.rdy = block_b_int_rdy_mux_in; + end + block_b_int_en_active: + begin + r2b.data = block_b_int_en_data_mux_in; + r2b.err = block_b_int_en_err_mux_in; + r2b.rdy = block_b_int_en_rdy_mux_in; + end + block_b_halt_en_active: + begin + r2b.data = block_b_halt_en_data_mux_in; + r2b.err = block_b_halt_en_err_mux_in; + r2b.rdy = block_b_halt_en_rdy_mux_in; + end + block_c_int_active: + begin + r2b.data = block_c_int_data_mux_in; + r2b.err = block_c_int_err_mux_in; + r2b.rdy = block_c_int_rdy_mux_in; + end + block_c_int_en_active: + begin + r2b.data = block_c_int_en_data_mux_in; + r2b.err = block_c_int_en_err_mux_in; + r2b.rdy = block_c_int_en_rdy_mux_in; + end + block_c_halt_en_active: + begin + r2b.data = block_c_halt_en_data_mux_in; + r2b.err = block_c_halt_en_err_mux_in; + r2b.rdy = block_c_halt_en_rdy_mux_in; + end + block_d_int_active: + begin + r2b.data = block_d_int_data_mux_in; + r2b.err = block_d_int_err_mux_in; + r2b.rdy = block_d_int_rdy_mux_in; + end + block_d_int_en_active: + begin + r2b.data = block_d_int_en_data_mux_in; + r2b.err = block_d_int_en_err_mux_in; + r2b.rdy = block_d_int_en_rdy_mux_in; + end + block_d_halt_en_active: + begin + r2b.data = block_d_halt_en_data_mux_in; + r2b.err = block_d_halt_en_err_mux_in; + r2b.rdy = block_d_halt_en_rdy_mux_in; + end + master_int_active: + begin + r2b.data = master_int_data_mux_in; + r2b.err = master_int_err_mux_in; + r2b.rdy = master_int_rdy_mux_in; + end + master_halt_active: + begin + r2b.data = master_halt_data_mux_in; + r2b.err = master_halt_err_mux_in; + r2b.rdy = master_halt_rdy_mux_in; + end + master_int_en_active: + begin + r2b.data = master_int_en_data_mux_in; + r2b.err = master_int_en_err_mux_in; + r2b.rdy = master_int_en_rdy_mux_in; + end + master_halt_en_active: + begin + r2b.data = master_halt_en_data_mux_in; + r2b.err = master_halt_en_err_mux_in; + r2b.rdy = master_halt_en_rdy_mux_in; + end + global_int_active: + begin + r2b.data = global_int_data_mux_in; + r2b.err = global_int_err_mux_in; + r2b.rdy = global_int_rdy_mux_in; + end + global_int_en_active: + begin + r2b.data = global_int_en_data_mux_in; + r2b.err = global_int_en_err_mux_in; + r2b.rdy = global_int_en_rdy_mux_in; + end + default: + begin + // If the address is not found, return an error + r2b.data = 0; + r2b.err = 1; + r2b.rdy = b2r.r_vld || b2r.w_vld; + end + endcase +end +endmodule diff --git a/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_amba3ahblite.sv b/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_amba3ahblite.sv new file mode 100644 index 0000000..055df5f --- /dev/null +++ b/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_amba3ahblite.sv @@ -0,0 +1,314 @@ +/* + * Copyright 2021 Dennis Potter + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, + * copy, modify, merge, publish, distribute, sublicense, and/or + * sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following + * conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + */ + +module srdl2sv_amba3ahblite + import srdl2sv_if_pkg::*; +#( + parameter bit FLOP_REGISTER_IF = 0, + parameter BUS_BITS = 32, + parameter NO_BYTE_ENABLE = 0 +) +( + // Outputs to internal logic + output b2r_t b2r, + + // Inputs from internal logic + input r2b_t r2b, + + // Bus protocol + input HCLK, + input HRESETn, + input HSEL, + input [31:0] HADDR, + input HWRITE, + input [ 2:0] HSIZE, + input [ 3:0] HPROT, // Might be used in the future together with an RDL UDP + input [ 1:0] HTRANS, + input [BUS_BITS-1:0] HWDATA, + + output logic HREADYOUT, + output logic HRESP, + output logic [BUS_BITS-1:0] HRDATA +); + + localparam BUS_BYTES = BUS_BITS/8; + localparam BUS_BYTES_W = $clog2(BUS_BYTES); + + /*********************** + * Define enums + ***********************/ + typedef enum logic [2:0] { + SINGLE = 3'b000, + INCR = 3'b001, + WRAP4 = 3'b010, + INCR4 = 3'b011, + WRAP8 = 3'b100, + INCR8 = 3'b101, + WRAP16 = 3'b110, + INCR16 = 3'b111 + } HBURST_t; + + typedef enum logic [1:0] { + IDLE = 2'b00, + BUSY = 2'b01, + NONSEQ = 2'b10, + SEQ = 2'b11 + } HTRANS_t; + + typedef enum logic { + OKAY = 1'b0, + ERROR = 1'b1 + } HRESP_t; + + typedef enum logic { + READ = 1'b0, + WRITE = 1'b1 + } OP_t; + + typedef enum logic [1:0] { + FSM_IDLE = 2'b00, + FSM_TRANS = 2'b01, + FSM_ERR_0 = 2'b10, + FSM_ERR_1 = 2'b11 + } fsm_t; + + /**************************** + * Determine current address + ****************************/ + logic [31:0] HADDR_q; + logic [2:0] HSIZE_q; + OP_t operation_q; + + wire addr_err = HADDR % (32'b1 << HSIZE) != 32'b0; + + always_ff @ (posedge HCLK) + begin + case (HTRANS) + IDLE: ;// Do nothing + BUSY: ;// Do nothing + NONSEQ: + begin + // When a transfer is extended it has the side-effecxt + // of extending the address phase of the next transfer + if (HREADYOUT) + begin + HADDR_q <= HADDR; + HSIZE_q <= HSIZE; + operation_q <= HWRITE ? WRITE : READ; + end + end + SEQ: + begin + if (HREADYOUT) + begin + HADDR_q <= HADDR; + HSIZE_q <= HSIZE; + end + end + endcase + end + + /**************************** + * Statemachine + ****************************/ + logic [BUS_BITS-1:0] HRDATA_temp; + fsm_t fsm_next, fsm_q; + + always_comb + begin + // Defaults + HREADYOUT = 1'b1; + HRESP = 1'b0; + + // When reading back, the data of the bit that was accessed over the bus + // should be at byte 0 of the HRDATA bus and bits that were not accessed + // should be masked with 0s. + HRDATA_temp = r2b.data >> (8*HADDR_q[BUS_BYTES_W-1:0]); + + for (int i = 0; i < BUS_BYTES; i++) + if (i < (1 << HSIZE_q)) + HRDATA[8*(i+1)-1 -: 8] = HRDATA_temp[8*(i+1)-1 -: 8]; + else + HRDATA[8*(i+1)-1 -: 8] = 8'b0; + + b2r_w_vld_next = 0; + b2r_r_vld_next = 0; + fsm_next = fsm_q; + + case (fsm_q) + default: // FSM_IDLE + begin + if (HSEL && HTRANS > BUSY) + begin + if (addr_err) + // In case the address is illegal, switch to an error state + fsm_next = FSM_ERR_0; + else if (HTRANS == NONSEQ) + // If NONSEQ, go to NONSEQ state + fsm_next = FSM_TRANS; + else if (HTRANS == SEQ) + // If a SEQ is provided, something is wrong + fsm_next = FSM_ERR_0; + end + end + FSM_TRANS: + begin + HREADYOUT = r2b.rdy; + b2r_w_vld_next = operation_q == WRITE; + b2r_r_vld_next = operation_q == READ; + + if (r2b.err && r2b.rdy) + begin + fsm_next = FSM_ERR_0; + end + else if (HTRANS == BUSY) + begin + // Wait + fsm_next = FSM_TRANS; + end + else if (HTRANS == NONSEQ) + begin + // Another unrelated access is coming + fsm_next = FSM_TRANS; + end + else if (HTRANS == SEQ) + begin + // Another part of the burst is coming + fsm_next = FSM_TRANS; + end + else if (HTRANS == IDLE) + begin + // All done, wrapping things up! + fsm_next = r2b.rdy ? FSM_IDLE : FSM_TRANS; + end + end + FSM_ERR_0: + begin + HREADYOUT = 0; + + if (HTRANS == BUSY) + begin + // Slaves must always provide a zero wait state OKAY response + // to BUSY transfers and the transfer must be ignored by the slave. + HRESP = OKAY; + fsm_next = FSM_ERR_0; + end + else + begin + HRESP = ERROR; + fsm_next = FSM_ERR_1; + end + end + FSM_ERR_1: + begin + if (HTRANS == BUSY) + begin + // Slaves must always provide a zero wait state OKAY response + // to BUSY transfers and the transfer must be ignored by the slave. + HREADYOUT = 0; + HRESP = OKAY; + fsm_next = FSM_ERR_0; + end + else + begin + HREADYOUT = 1; + HRESP = ERROR; + + fsm_next = FSM_IDLE; + end + end + endcase + end + + + always_ff @ (posedge HCLK or negedge HRESETn) + if (!HRESETn) + fsm_q <= FSM_IDLE; + else + fsm_q <= fsm_next; + + /*** + * Determine the number of active bytes + ***/ + logic [BUS_BYTES-1:0] HSIZE_bitfielded; + logic [BUS_BYTES-1:0] b2r_byte_en_next; + logic b2r_w_vld_next; + logic b2r_r_vld_next; + + generate + if (NO_BYTE_ENABLE) + begin + assign b2r_byte_en_next = {BUS_BYTES{1'b1}}; + end + else + begin + always_comb + begin + for (int i = 0; i < BUS_BYTES; i++) + HSIZE_bitfielded[i] = i < (1 << HSIZE_q); + + // Shift if not the full bus is accessed + b2r_byte_en_next = HSIZE_bitfielded << (HADDR_q % BUS_BYTES); + end + end + endgenerate + + /*** + * Drive interface to registers + ***/ + generate + if (FLOP_REGISTER_IF) + begin + always_ff @ (posedge HCLK or negedge HRESETn) + if (!HRESETn) + begin + b2r.w_vld <= 1'b0; + b2r.r_vld <= 1'b0; + end + else + begin + b2r.w_vld <= b2r_w_vld_next; + b2r.r_vld <= b2r_r_vld_next; + end + + always_ff @ (posedge HCLK) + begin + b2r.addr <= {HADDR_q[31:BUS_BYTES_W], {BUS_BYTES_W{1'b0}}}; + b2r.data <= HWDATA << (8*HADDR_q[BUS_BYTES_W-1:0]); + b2r.byte_en <= b2r_byte_en_next; + end + end + else + begin + assign b2r.w_vld = b2r_w_vld_next; + assign b2r.r_vld = b2r_r_vld_next; + assign b2r.addr = {HADDR_q[31:BUS_BYTES_W], {BUS_BYTES_W{1'b0}}}; + assign b2r.data = HWDATA << (8*HADDR_q[BUS_BYTES_W-1:0]); + assign b2r.byte_en = b2r_byte_en_next; + end + endgenerate + +endmodule + diff --git a/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_if_pkg.sv b/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_if_pkg.sv new file mode 100644 index 0000000..f5434eb --- /dev/null +++ b/examples/interrupt_hierarchy/srdl2sv_out/srdl2sv_if_pkg.sv @@ -0,0 +1,18 @@ +package srdl2sv_if_pkg; + +typedef struct packed { // .Verilator does not support unpacked structs in packages + logic [31:0] addr; + logic [31:0] data; + logic w_vld; + logic r_vld; + logic [ 3:0] byte_en; +} b2r_t; + +typedef struct packed { // .Verilator does not support unpacked structs in packages + logic [31:0] data; + logic rdy; + logic err; +} r2b_t; + +endpackage +