| // Copyright lowRISC contributors. |
| // Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| // SPDX-License-Identifier: Apache-2.0 |
| // |
| // TOP Earlgrey configuration |
| { name: "earlgrey", |
| type: "top", |
| |
| ///////////////////////////////////////////////////////////// |
| // Seed for compile-time random constants // |
| // NOTE: REPLACE THIS WITH A NEW VALUE BEFORE THE TAPEOUT // |
| ///////////////////////////////////////////////////////////// |
| rnd_cnst_seed: 4881560218908238235 |
| |
| // 32-bit datawidth |
| datawidth: "32", |
| |
| // Power information for the design |
| power: { |
| // Power domains supported by the design |
| // Aon represents domain aon |
| // 0 represents domain 0 |
| domains: ["Aon", "0"], |
| |
| // Default power domain used for the design |
| default: "0" |
| }, |
| |
| // This is the clock data structure of the design. |
| // The hier path refers to the clock reference path (struct / port) |
| // - The top/ext desgination follows the same scheme as inter-module |
| // The src key indicates the raw clock sources in the design |
| // The groups key indicates the various clock groupings in the design |
| clocks: { |
| |
| hier_paths: { |
| top: "clkmgr_aon_clocks.", // top level is a struct |
| ext: "", // ext is a port of the clock name |
| }, |
| |
| // Clock Source attributes |
| // name: Name of group. |
| // aon: Whether the clock is free running all the time. |
| // If it is, the clock is not hanlded by clkmgr. |
| // freq: Absolute frequency of clk in Hz |
| srcs: [ |
| { name: "main", aon: "no", freq: "100000000" } |
| { name: "io", aon: "no", freq: "96000000" } |
| { name: "usb", aon: "no", freq: "48000000" } |
| { name: "aon", aon: "yes", freq: "200000" } |
| ], |
| |
| // Derived clock source attributes |
| // name: Name of group. |
| // aon: Whether the clock is free running all the time. |
| // If it is, the clock is not hanlded by clkmgr. |
| // freq: Absolute frequency of clk in Hz |
| // src: From which clock source is the clock derived |
| // div: Ratio between derived clock and source clock |
| derived_srcs: [ |
| { name: "io_div2", aon: "no", div: 2, src: "io", freq: "48000000" } |
| { name: "io_div4", aon: "no", div: 4, src: "io", freq: "24000000" } |
| ], |
| |
| // Clock Group attributes |
| // name: name of group. |
| // |
| // src: The hierarchical source of the clock |
| // "ext" - clock is supplied from a port of the top module |
| // "top" - clock is supplied from a net inside the top module |
| // |
| // sw_cg: whether software is allowed to gate the clock |
| // "no" - software is not allowed to gate clocks |
| // "yes" - software is allowed to gate clocks |
| // "hint" - software can provide a hint, and hw controls the rest |
| // |
| // unique: whether each module in the group can be separately gated |
| // if sw_cg is "no", this field has no meaning |
| // "yes" - each clock is individually controlled |
| // "no" - the group is controlled as one single unit |
| // |
| // The powerup and proc groups are unique. |
| // The powerup group of clocks do not feed through the clock |
| // controller as they manage clock controller behavior |
| // The proc group is not peripheral, and directly hardwired |
| |
| groups: [ |
| // the powerup group is used exclusively by clk/pwr/rstmgr/pinmux |
| { name: "powerup", src:"top", sw_cg: "no" } |
| { name: "trans", src:"top", sw_cg: "hint", unique: "yes", } |
| { name: "infra", src:"top", sw_cg: "no", } |
| { name: "secure", src:"top", sw_cg: "no" } |
| { name: "peri", src:"top", sw_cg: "yes", unique: "no" } |
| { name: "timers", src:"top", sw_cg: "no" } |
| { name: "proc", |
| src: "no", |
| sw_cg: "no", |
| unique: "no", |
| clocks: { |
| clk_proc_main: main |
| } |
| } |
| ], |
| }, |
| |
| // This is the reset data strcture of the design. |
| // The hier path refers to the reset reference path (struct / port) |
| // - The top/ext desgination follows the same scheme as inter-module |
| // The node key represents all the known resets in the design |
| resets: { |
| |
| hier_paths: { |
| top: "rstmgr_aon_resets.", // top level is a struct |
| ext: "", // ext is a port of the clock name |
| }, |
| |
| // Reset node attributes |
| // name: name of reset. |
| // |
| // gen: whether the reset is generated |
| // true: it is a generated reset inside rstmgr |
| // false: it is a hardwired design reset inside rstmgr (roots and por) |
| // For non-generated resets, the parent / domain definitions have no meaning. |
| // |
| // type: the reset type [ext, top] |
| // ext: the reset is coming in from the ports, external to earlgrey |
| // int: the reset is only used inside rstmgr |
| // top: the reset is output from rstmgr to top level struct |
| // |
| // parent: The parent reset |
| // If type is "ext", there is no root, since it is external |
| // |
| // domains: The power domains of a particular reset |
| // This is a list of of the supported power domains. |
| // Valid values are Aon and (power domain)0 ~ (power domain)1. |
| // If no value is supplied, the default is only the Aon version. |
| // |
| // clk: related clock domain for synchronous release |
| // If type is "por", there is not related clock, since it is |
| // likely external or generated from a voltage comparator |
| // |
| nodes: [ |
| { name: "rst_ni", gen: false, type: "ext", } |
| { name: "por_aon", gen: false, type: "top", domains: ["Aon" ], clk: "aon" } |
| { name: "lc_src", gen: false, type: "int", domains: ["Aon", "0"], clk: "io_div4" } |
| { name: "sys_src", gen: false, type: "int", domains: ["Aon", "0"], clk: "io_div4" } |
| { name: "por", gen: true, type: "top", domains: ["Aon" ], parent: "por_aon", clk: "main" } |
| { name: "por_io", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io" } |
| { name: "por_io_div2", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io_div2" } |
| { name: "por_io_div4", gen: true , type: "top", domains: ["Aon", ], parent: "por_aon", clk: "io_div4" } |
| { name: "por_usb", gen: true, type: "top", domains: ["Aon", ], parent: "por_aon", clk: "usb" } |
| { name: "lc", gen: true, type: "top", domains: [ "0"], parent: "lc_src", clk: "main" } |
| { name: "lc_io_div4", gen: true, type: "top", domains: [ "0"], parent: "lc_src", clk: "io_div4" } |
| { name: "sys", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "main" } |
| { name: "sys_io_div4", gen: true, type: "top", domains: ["Aon", "0"], parent: "sys_src", clk: "io_div4" } |
| { name: "sys_aon", gen: true, type: "top", domains: ["Aon", "0"], parent: "sys_src", clk: "aon" } |
| { name: "spi_device", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 } |
| { name: "spi_host0", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 } |
| { name: "spi_host1", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 } |
| { name: "usb", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "usb", sw: 1 } |
| { name: "i2c0", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 }, |
| { name: "i2c1", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 }, |
| { name: "i2c2", gen: true, type: "top", domains: [ "0"], parent: "sys_src", clk: "io_div2", sw: 1 }, |
| ] |
| } |
| |
| // Number of cores: used in rv_plic and timer |
| num_cores: "1", |
| |
| |
| // `host` defines the host only components in the system (such as processor) |
| // This should eventually be used to cover more functionality, but for now, |
| // it is a temporary solution for top level connectivity |
| host: [ |
| { name: "rv_core_ibex", |
| type: "rv_core_ibex", |
| inter_signal_list: [ |
| { struct: "esc_tx", |
| type: "uni", |
| name: "esc_nmi_tx", |
| act: "rcv", |
| package: "prim_esc_pkg", |
| }, |
| |
| { struct: "esc_rx", |
| type: "uni", |
| name: "esc_nmi_rx", |
| act: "req", |
| package: "prim_esc_pkg", |
| }, |
| |
| { struct: "crash_dump", |
| type: "uni", |
| name: "crash_dump", |
| act: "req", |
| package: "ibex_pkg", |
| }, |
| |
| { struct: "lc_tx_t", |
| type: "uni", |
| name: "lc_cpu_en", |
| act: "rcv", |
| package: "lc_ctrl_pkg", |
| }, |
| |
| { struct: "ram_1p_cfg_t", |
| type: "uni", |
| name: "ram_cfg", |
| act: "rcv", |
| package: "prim_ram_1p_pkg" |
| } |
| ], |
| } |
| { name: "rv_dm", |
| type: "rv_dm", |
| inter_signal_list: [ |
| { struct: "jtag", |
| type: "req_rsp", |
| name: "jtag", |
| act: "rsp", |
| package: "jtag_pkg", |
| }, |
| ] |
| } |
| ] |
| |
| // `module` defines the peripherals. |
| // Details are coming from each modules' config file `ip.hjson` |
| // TODO: Define parameter here |
| // attr: There are a few types of modules supported |
| // normal(default): Normal, non-templated modules that will be instantiated |
| // templated: These modules are templated and must be run through topgen |
| // reggen_top: These modules are not templated, but need to have reggen run |
| // because they live exclusively in hw/top_* instead of hw/ip_*. |
| // These modules are also instantiated in the top level. |
| // reggen_only: Similar to reggen_top, but are not instantiated in the top level. |
| module: [ |
| { name: "uart0", // instance name |
| type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted) |
| // and `hw/ip/{type}` |
| |
| // clock connections defines the port to top level clock connection |
| // the ip.hjson will declare the clock port names |
| // If none are defined at ip.hjson, clk_i is used by default |
| clock_srcs: {clk_i: "io_div4"}, |
| |
| // reset connections defines the port to top level reset connection |
| // the ip.hjson will declare the reset port names |
| // If none are defined at ip.hjson, rst_ni is used by default |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40000000", |
| }, |
| { name: "uart1", // instance name |
| type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted) |
| // and `hw/ip/{type}` |
| |
| // clock connections defines the port to top level clock connection |
| // the ip.hjson will declare the clock port names |
| // If none are defined at ip.hjson, clk_i is used by default |
| clock_srcs: {clk_i: "io_div4"}, |
| |
| // reset connections defines the port to top level reset connection |
| // the ip.hjson will declare the reset port names |
| // If none are defined at ip.hjson, rst_ni is used by default |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40010000", |
| }, |
| { name: "uart2", // instance name |
| type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted) |
| // and `hw/ip/{type}` |
| |
| // clock connections defines the port to top level clock connection |
| // the ip.hjson will declare the clock port names |
| // If none are defined at ip.hjson, clk_i is used by default |
| clock_srcs: {clk_i: "io_div4"}, |
| |
| // reset connections defines the port to top level reset connection |
| // the ip.hjson will declare the reset port names |
| // If none are defined at ip.hjson, rst_ni is used by default |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40020000", |
| }, |
| { name: "uart3", // instance name |
| type: "uart", // Must be matched to the ip name in `ip.hson` (_reg, _cfg permitted) |
| // and `hw/ip/{type}` |
| |
| // clock connections defines the port to top level clock connection |
| // the ip.hjson will declare the clock port names |
| // If none are defined at ip.hjson, clk_i is used by default |
| clock_srcs: {clk_i: "io_div4"}, |
| |
| // reset connections defines the port to top level reset connection |
| // the ip.hjson will declare the reset port names |
| // If none are defined at ip.hjson, rst_ni is used by default |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40030000", |
| }, |
| { name: "gpio", |
| type: "gpio", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40040000", |
| } |
| { name: "spi_device", |
| type: "spi_device", |
| clock_srcs: {clk_i: "io_div4", scan_clk_i: "io_div2"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "spi_device"}, |
| base_addr: "0x40050000", |
| }, |
| { name: "spi_host0", |
| type: "spi_host", |
| clock_srcs: {clk_i: "io_div4", clk_core_i: "io_div2"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "spi_host0", rst_core_ni: "spi_host0"}, |
| base_addr: "0x40060000", |
| }, |
| { name: "spi_host1", |
| type: "spi_host", |
| clock_srcs: {clk_i: "io_div4", clk_core_i: "io_div2"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "spi_host1", rst_core_ni: "spi_host1"}, |
| base_addr: "0x40070000", |
| }, |
| { name: "i2c0", |
| type: "i2c", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "i2c0"}, |
| base_addr: "0x40080000", |
| }, |
| { name: "i2c1", |
| type: "i2c", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "i2c1"}, |
| base_addr: "0x40090000", |
| }, |
| { name: "i2c2", |
| type: "i2c", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "i2c2"}, |
| base_addr: "0x400A0000", |
| }, |
| { name: "pattgen", |
| type: "pattgen", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x400E0000", |
| }, |
| { name: "rv_timer", |
| type: "rv_timer", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "timers", |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40100000", |
| }, |
| { name: "usbdev", |
| type: "usbdev", |
| clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon", clk_usb_48mhz_i: "usb"}, |
| clock_group: "peri", |
| clock_reset_export: ["ast"], |
| reset_connections: {rst_ni: "sys_io_div4", rst_aon_ni: "sys_aon", rst_usb_48mhz_ni: "usb"}, |
| base_addr: "0x40110000", |
| }, |
| { name: "otp_ctrl", |
| type: "otp_ctrl", |
| clock_srcs: {clk_i: "io_div4", clk_edn_i: "main"}, |
| clock_group: "timers", |
| reset_connections: {rst_ni: "lc_io_div4", rst_edn_ni: "sys"}, |
| base_addr: "0x40130000", |
| }, |
| { name: "lc_ctrl", |
| type: "lc_ctrl", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "timers", |
| reset_connections: {rst_ni: "lc_io_div4"}, |
| base_addr: "0x40140000", |
| }, |
| { name: "alert_handler", |
| type: "alert_handler", |
| clock_srcs: {clk_i: "io_div4", clk_edn_i: "main"}, |
| clock_group: "timers", |
| reset_connections: {rst_ni: "sys_io_div4", rst_edn_ni: "sys"}, |
| base_addr: "0x40150000", |
| attr: "templated", |
| localparam: { |
| EscCntDw: 32, |
| AccuCntDw: 16, |
| LfsrSeed: "0x7FFFFFFF" |
| } |
| }, |
| // dummy module to capture the alert handler escalation signals |
| // and test them by converting them into IRQs |
| // { name: "nmi_gen", |
| // type: "nmi_gen", |
| // clock_srcs: {clk_i: "io_div4"}, |
| // clock_group: "timers", |
| // reset_connections: {rst_ni: "sys_io_div4"}, |
| // base_addr: "0x40160000", |
| // } |
| { name: "pwrmgr_aon", |
| type: "pwrmgr", |
| clock_srcs: {clk_i: "io_div4", clk_slow_i: "aon"}, |
| clock_group: "powerup", |
| reset_connections: {rst_ni: "por", rst_slow_ni: "por_aon"}, |
| domain: "Aon", |
| base_addr: "0x40400000", |
| attr: "templated", |
| |
| }, |
| { name: "rstmgr_aon", |
| type: "rstmgr", |
| clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon", clk_main_i: "main", clk_io_i: "io", clk_usb_i: "usb", |
| clk_io_div2_i: "io_div2", clk_io_div4_i: "io_div4"}, |
| clock_group: "powerup", |
| reset_connections: {rst_ni: "rst_ni"}, |
| domain: "Aon", |
| base_addr: "0x40410000", |
| attr: "templated", |
| }, |
| { name: "clkmgr_aon", |
| type: "clkmgr", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "powerup", |
| reset_connections: {rst_ni: "por_io_div4", rst_main_ni: "por", rst_io_ni: "por_io", rst_usb_ni: "por_usb" |
| rst_io_div2_ni: "por_io_div2", rst_io_div4_ni: "por_io_div4"}, |
| domain: "Aon", |
| base_addr: "0x40420000", |
| attr: "templated", |
| }, |
| { name: "adc_ctrl_aon", |
| type: "adc_ctrl", |
| clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "sys_io_div4", rst_slow_ni: "sys_aon"}, |
| clock_reset_export: ["ast"], |
| domain: "Aon", |
| base_addr: "0x40440000" |
| }, |
| { name: "pinmux_aon", |
| type: "pinmux", |
| clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon"}, |
| clock_group: "powerup", |
| reset_connections: {rst_ni: "sys_io_div4", rst_aon_ni: "sys_aon"}, |
| domain: "Aon", |
| base_addr: "0x40460000", |
| attr: "templated", |
| }, |
| { name: "aon_timer_aon", |
| type: "aon_timer", |
| clock_srcs: {clk_i: "io_div4", clk_aon_i: "aon"}, |
| clock_group: "timers", |
| reset_connections: {rst_ni: "sys_io_div4", rst_aon_ni: "sys_aon"}, |
| domain: "Aon", |
| base_addr: "0x40470000", |
| attr: "templated", |
| }, |
| { name: "ast", |
| type: "ast", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "secure", |
| clock_reset_export: ["ast"], |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| base_addr: "0x40480000", |
| attr: "reggen_only", |
| }, |
| { name: "sensor_ctrl_aon", |
| type: "sensor_ctrl", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "secure", |
| clock_reset_export: ["ast"], |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| domain: "Aon", |
| base_addr: "0x40490000", |
| attr: "reggen_top", |
| }, |
| { name: "sram_ctrl_ret_aon", |
| type: "sram_ctrl", |
| clock_srcs: {clk_i: "io_div4", clk_otp_i: "io_div4"}, |
| clock_group: "peri", |
| reset_connections: {rst_ni: "sys_io_div4", rst_otp_ni: "lc_io_div4"}, |
| domain: "Aon", |
| base_addr: "0x40500000" |
| }, |
| { name: "flash_ctrl", |
| type: "flash_ctrl", |
| clock_srcs: {clk_i: "main", clk_otp_i: "io_div4"}, |
| clock_group: "infra", |
| reset_connections: {rst_ni: "lc", rst_otp_ni: "lc_io_div4"}, |
| base_addrs: {core: "0x41000000", prim: "0x41008000"} |
| attr: "templated", |
| }, |
| { name: "rv_plic", |
| type: "rv_plic", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys"}, |
| base_addr: "0x41010000", |
| attr: "templated", |
| }, |
| { name: "aes", |
| type: "aes", |
| clock_srcs: {clk_i: "main", clk_edn_i: "main"}, |
| clock_group: "trans", |
| reset_connections: {rst_ni: "sys", rst_edn_ni: "sys"}, |
| base_addr: "0x41100000", |
| }, |
| { name: "hmac", |
| type: "hmac", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "trans", |
| reset_connections: {rst_ni: "sys"}, |
| base_addr: "0x41110000", |
| }, |
| { name: "kmac" |
| type: "kmac" |
| clock_srcs: {clk_i: "main", clk_edn_i: "main"} |
| clock_group: "trans" |
| reset_connections: {rst_ni: "sys", rst_edn_ni: "sys"} |
| base_addr: "0x41120000" |
| }, |
| { name: "keymgr", |
| type: "keymgr", |
| clock_srcs: {clk_i: "main", clk_edn_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys", rst_edn_ni: "sys"}, |
| base_addr: "0x41130000", |
| }, |
| { name: "csrng", |
| type: "csrng", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys"}, |
| base_addr: "0x41150000", |
| }, |
| { name: "entropy_src", |
| type: "entropy_src", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys"}, |
| clock_reset_export: ["ast"], |
| base_addr: "0x41160000", |
| }, |
| { name: "edn0", |
| type: "edn", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys"}, |
| clock_reset_export: ["ast"], |
| base_addr: "0x41170000", |
| }, |
| { name: "edn1", |
| type: "edn", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys"}, |
| base_addr: "0x41180000", |
| }, |
| { name: "sram_ctrl_main", |
| type: "sram_ctrl", |
| clock_srcs: {clk_i: "main", clk_otp_i: "io_div4"}, |
| clock_group: "secure", |
| reset_connections: {rst_ni: "sys", rst_otp_ni: "lc_io_div4"}, |
| base_addr: "0x411C0000", |
| }, |
| { name: "otbn", |
| type: "otbn", |
| clock_srcs: {clk_i: "main", clk_edn_i: "main"}, |
| clock_group: "trans", |
| reset_connections: {rst_ni: "sys", rst_edn_ni: "sys"}, |
| base_addr: "0x411D0000", |
| }, |
| { name: "rom_ctrl", |
| type: "rom_ctrl", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "infra", |
| reset_connections: {rst_ni: "sys"}, |
| base_addrs: {rom: "0x00008000", regs: "0x411e0000"} |
| } |
| ] |
| |
| // Memories (ROM, RAM, eFlash) are defined at the top. |
| // It utilizes the primitive cells but configurable |
| memory: [ |
| { name: "ram_main", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "infra", |
| reset_connections: {rst_ni: "sys"}, |
| type: "ram_1p_scr", |
| base_addr: "0x10000000", |
| size: "0x20000", |
| byte_write: "true", |
| // data integrity width |
| integ_width: 7, |
| exec: "1", |
| inter_signal_list: [ |
| { struct: "tl" |
| package: "tlul_pkg" |
| type: "req_rsp" |
| act: "rsp" |
| name: "tl" |
| }, |
| // Interface to SRAM controller |
| { struct: "sram_scr", |
| package: "sram_ctrl_pkg" |
| type: "req_rsp", |
| name: "sram_scr", |
| act: "rsp", |
| }, |
| { struct: "sram_scr_init", |
| package: "sram_ctrl_pkg" |
| type: "req_rsp", |
| name: "sram_scr_init", |
| act: "rsp", |
| }, |
| { struct: "tl_instr_en", |
| package: "tlul_pkg" |
| type: "uni", |
| name: "en_ifetch", |
| act: "rcv", |
| }, |
| { struct: "logic", |
| package: "" |
| type: "uni", |
| name: "intg_error", |
| act: "req", |
| }, |
| // Interface to memory configuration |
| { struct: "ram_1p_cfg", |
| package: "prim_ram_1p_pkg", |
| type: "uni", |
| name: "cfg", |
| act: "rcv" |
| } |
| ] |
| }, |
| { name: "ram_ret_aon", |
| clock_srcs: {clk_i: "io_div4"}, |
| clock_group: "infra", |
| reset_connections: {rst_ni: "sys_io_div4"}, |
| domain: "Aon", |
| type: "ram_1p_scr", |
| base_addr: "0x40600000", |
| size: "0x1000", |
| byte_write: "true", |
| // data integrity width |
| integ_width: 7, |
| exec: "0", |
| inter_signal_list: [ |
| { struct: "tl" |
| package: "tlul_pkg" |
| type: "req_rsp" |
| act: "rsp" |
| name: "tl" |
| }, |
| // Interface to SRAM controller |
| { struct: "sram_scr", |
| package: "sram_ctrl_pkg" |
| type: "req_rsp", |
| name: "sram_scr", |
| act: "rsp", |
| }, |
| { struct: "sram_scr_init", |
| package: "sram_ctrl_pkg" |
| type: "req_rsp", |
| name: "sram_scr_init", |
| act: "rsp", |
| }, |
| { struct: "tl_instr_en", |
| package: "tlul_pkg" |
| type: "uni", |
| name: "en_ifetch", |
| act: "rcv", |
| }, |
| { struct: "logic", |
| package: "" |
| type: "uni", |
| name: "intg_error", |
| act: "req", |
| }, |
| // Interface to memory configuration |
| { struct: "ram_1p_cfg", |
| package: "prim_ram_1p_pkg", |
| type: "uni", |
| name: "cfg", |
| act: "rcv" |
| } |
| ] |
| }, |
| { name: "eflash", |
| clock_srcs: {clk_i: "main"}, |
| clock_group: "infra", |
| reset_connections: {rst_ni: "lc"}, |
| type: "eflash", |
| base_addr: "0x20000000", |
| banks: 2, |
| pages_per_bank: 256, |
| program_resolution: 8, // maximum number of flash words allowed to program at one time |
| swaccess: "ro", |
| inter_signal_list: [ |
| { struct: "flash", // flash_req_t, flash_rsp_t |
| type: "req_rsp", |
| name: "flash_ctrl", // flash_ctrl_i (req), flash_ctrl_o (rsp) |
| act: "rsp", |
| }, |
| { struct: "tl" |
| package: "tlul_pkg" |
| type: "req_rsp" |
| act: "rsp" |
| name: "tl" |
| }, |
| { struct: "lc_tx", |
| package: "lc_ctrl_pkg", |
| type: "uni" |
| act: "rcv" |
| name: "lc_nvm_debug_en" |
| }, |
| { struct: "lc_tx" |
| package: "lc_ctrl_pkg" |
| type: "uni" |
| act: "rcv" |
| name: "flash_bist_enable" |
| }, |
| { struct: "logic" |
| package: "" |
| type: "uni" |
| act: "rcv" |
| name: "flash_power_down_h" |
| }, |
| { struct: "logic" |
| package: "" |
| type: "uni" |
| act: "rcv" |
| name: "flash_power_ready_h" |
| }, |
| { struct: "logic", |
| package: "", |
| width: "4", |
| type: "uni" |
| act: "rcv" |
| name: "flash_test_mode_a" |
| }, |
| { struct: "logic", |
| package: "", |
| type: "uni" |
| act: "rcv" |
| name: "flash_test_voltage_h" |
| }, |
| ], |
| }, |
| ], |
| |
| // The port data structure is not something that should be used liberally. |
| // It is used specifically to assign special attributes to specific ports. |
| // For example, this allows us to designate a port as part of inter-module |
| // connections. |
| port: [ |
| { name: "ast", |
| inter_signal_list: [ |
| { struct: "edn", |
| type: "req_rsp", |
| name: "edn", |
| // The activity direction for a port inter-signal is "opposite" of |
| // what the external module actually needs. |
| act: "rsp", |
| package: "edn_pkg", |
| }, |
| |
| { struct: "lc_tx", |
| type: "uni", |
| name: "lc_dft_en", |
| // The activity direction for a port inter-signal is "opposite" of |
| // what the external module actually needs. |
| act: "req", |
| package: "lc_ctrl_pkg", |
| }, |
| |
| { struct: "ram_1p_cfg", |
| package: "prim_ram_1p_pkg", |
| type: "uni", |
| name: "ram_1p_cfg", |
| // The activity direction for a port inter-signal is "opposite" of |
| // what the external module actually needs. |
| act: "rcv" |
| }, |
| |
| { struct: "ram_2p_cfg", |
| package: "prim_ram_2p_pkg", |
| type: "uni", |
| name: "ram_2p_cfg", |
| // The activity direction for a port inter-signal is "opposite" of |
| // what the external module actually needs. |
| act: "rcv" |
| }, |
| |
| { struct: "rom_cfg", |
| package: "prim_rom_pkg", |
| type: "uni", |
| name: "rom_cfg", |
| // The activity direction for a port inter-signal is "opposite" of |
| // what the external module actually needs. |
| act: "rcv" |
| } |
| ] |
| }, |
| ] |
| |
| // Inter-module Connection. |
| // format: |
| // requester: [ resp1, resp2, ... ], |
| // |
| // the field and value should be module_inst.port_name |
| // e.g flash_ctrl0.flash: [flash_phy0.flash_ctrl] |
| inter_module: { |
| 'connect': { |
| 'ast.ram_1p_cfg' : ['otbn.ram_cfg', 'ram_main.cfg', 'ram_ret_aon.cfg', 'rv_core_ibex.ram_cfg'], |
| 'ast.ram_2p_cfg' : ['spi_device.ram_cfg', 'usbdev.ram_cfg'], |
| 'ast.rom_cfg' : ['rom_ctrl.rom_cfg'], |
| 'alert_handler.crashdump' : ['rstmgr_aon.alert_dump'], |
| 'alert_handler.esc_rx' : ['rv_core_ibex.esc_nmi_rx', |
| 'lc_ctrl.esc_wipe_secrets_rx', |
| 'lc_ctrl.esc_scrap_state_rx' |
| 'pwrmgr_aon.esc_rst_rx'], |
| 'alert_handler.esc_tx' : ['rv_core_ibex.esc_nmi_tx', |
| 'lc_ctrl.esc_wipe_secrets_tx', |
| 'lc_ctrl.esc_scrap_state_tx', |
| 'pwrmgr_aon.esc_rst_tx'], |
| 'csrng.csrng_cmd' : ['edn0.csrng_cmd', 'edn1.csrng_cmd'], |
| 'csrng.entropy_src_hw_if' : ['entropy_src.entropy_src_hw_if'], |
| 'flash_ctrl.flash' : ['eflash.flash_ctrl'], |
| 'flash_ctrl.keymgr' : ['keymgr.flash'], |
| 'flash_ctrl.otp' : ['otp_ctrl.flash_otp_key'], |
| 'flash_ctrl.rma_req' : ['lc_ctrl.lc_flash_rma_req'], |
| 'flash_ctrl.rma_ack' : ['lc_ctrl.lc_flash_rma_ack'], |
| 'flash_ctrl.rma_seed' : ['lc_ctrl.lc_flash_rma_seed'], |
| 'sram_ctrl_main.sram_scr' : ['ram_main.sram_scr'], |
| 'sram_ctrl_main.sram_scr_init' : ['ram_main.sram_scr_init'], |
| 'sram_ctrl_ret_aon.sram_scr' : ['ram_ret_aon.sram_scr'], |
| 'sram_ctrl_ret_aon.sram_scr_init' : ['ram_ret_aon.sram_scr_init'], |
| 'sram_ctrl_main.en_ifetch' : ['ram_main.en_ifetch'], |
| 'sram_ctrl_ret_aon.en_ifetch' : ['ram_ret_aon.en_ifetch'], |
| 'ram_main.intg_error' : ['sram_ctrl_main.intg_error'], |
| 'ram_ret_aon.intg_error' : ['sram_ctrl_ret_aon.intg_error'], |
| 'otp_ctrl.sram_otp_key' : ['sram_ctrl_main.sram_otp_key', |
| 'sram_ctrl_ret_aon.sram_otp_key'] |
| 'pwrmgr_aon.pwr_flash' : ['flash_ctrl.pwrmgr'], |
| 'pwrmgr_aon.pwr_rst' : ['rstmgr_aon.pwr'], |
| 'pwrmgr_aon.pwr_clk' : ['clkmgr_aon.pwr'], |
| 'pwrmgr_aon.pwr_otp' : ['otp_ctrl.pwr_otp'], |
| 'pwrmgr_aon.pwr_lc' : ['lc_ctrl.pwr_lc'], |
| 'pwrmgr_aon.strap' : ['pinmux_aon.strap_en'], |
| 'pwrmgr_aon.low_power' : ['pinmux_aon.sleep_en','aon_timer_aon.sleep_mode'], |
| 'flash_ctrl.keymgr' : ['keymgr.flash'], |
| 'alert_handler.crashdump' : ['rstmgr_aon.alert_dump'], |
| 'rv_core_ibex.crash_dump' : ['rstmgr_aon.cpu_dump'], |
| 'csrng.entropy_src_hw_if' : ['entropy_src.entropy_src_hw_if'], |
| |
| // usbdev connection to pinmux |
| 'usbdev.usb_out_of_rst' : ['pinmux_aon.usb_out_of_rst'], |
| 'usbdev.usb_aon_wake_en' : ['pinmux_aon.usb_aon_wake_en'], |
| 'usbdev.usb_aon_wake_ack' : ['pinmux_aon.usb_aon_wake_ack'], |
| 'usbdev.usb_suspend' : ['pinmux_aon.usb_suspend'], |
| 'pinmux_aon.usb_state_debug' : ['usbdev.usb_state_debug'], |
| |
| // Edn connections |
| 'edn0.edn' : ['keymgr.edn', 'otp_ctrl.edn', 'ast.edn', 'kmac.entropy', |
| 'alert_handler.edn', 'aes.edn', 'otbn.edn_urnd'], |
| 'edn1.edn' : ['otbn.edn_rnd'], |
| |
| // KeyMgr Sideload & KDF function |
| 'otp_ctrl.otp_keymgr_key' : ['keymgr.otp_key'], |
| 'keymgr.kmac_key' : ['kmac.keymgr_key'] |
| |
| // KMAC Application Interface |
| 'kmac.app' : ['keymgr.kmac_data'] |
| |
| // The idle connection is automatically connected through topgen. |
| // The user does not need to explicitly declare anything other than |
| // an empty list. |
| 'clkmgr_aon.idle' : [], |
| |
| // Pinmux JTAG signals |
| // Note that the DFT TAP will be connected |
| // automatically by the DFT insertion tool, |
| // hence it does not have to be connected here. |
| 'pinmux_aon.lc_jtag' : ['lc_ctrl.jtag'], |
| 'pinmux_aon.rv_jtag' : ['rv_dm.jtag'], |
| |
| // OTP LC interface |
| 'otp_ctrl.otp_lc_data' : ['lc_ctrl.otp_lc_data'], |
| 'lc_ctrl.lc_otp_program' : ['otp_ctrl.lc_otp_program'], |
| 'lc_ctrl.lc_otp_token' : ['otp_ctrl.lc_otp_token'], |
| |
| // HW_CFG broadcast |
| 'otp_ctrl.otp_hw_cfg' : ['lc_ctrl.otp_hw_cfg', 'keymgr.otp_hw_cfg', |
| 'sram_ctrl_main.otp_hw_cfg', 'sram_ctrl_ret_aon.otp_hw_cfg'], |
| |
| // Diversification constant coming from life cycle |
| 'lc_ctrl.lc_keymgr_div' : ['keymgr.lc_keymgr_div'], |
| |
| // LC function control signal broadcast |
| 'lc_ctrl.lc_dft_en' : ['otp_ctrl.lc_dft_en', |
| 'pinmux_aon.lc_dft_en', |
| 'ast.lc_dft_en' |
| ], |
| 'lc_ctrl.lc_nvm_debug_en' : ['eflash.lc_nvm_debug_en'], |
| 'lc_ctrl.lc_hw_debug_en' : ['sram_ctrl_main.lc_hw_debug_en', |
| 'sram_ctrl_ret_aon.lc_hw_debug_en', |
| 'pinmux_aon.lc_hw_debug_en'], |
| 'lc_ctrl.lc_cpu_en' : ['rv_core_ibex.lc_cpu_en', 'aon_timer_aon.lc_cpu_en'], |
| 'lc_ctrl.lc_keymgr_en' : ['keymgr.lc_keymgr_en'], |
| 'lc_ctrl.lc_escalate_en' : ['aes.lc_escalate_en', |
| 'otp_ctrl.lc_escalate_en', |
| 'sram_ctrl_main.lc_escalate_en', |
| 'sram_ctrl_ret_aon.lc_escalate_en'], |
| |
| 'lc_ctrl.lc_check_byp_en' : ['otp_ctrl.lc_check_byp_en'], |
| 'lc_ctrl.lc_clk_byp_req' : ['clkmgr_aon.lc_clk_byp_req'], |
| 'lc_ctrl.lc_clk_byp_ack' : ['clkmgr_aon.lc_clk_byp_ack'], |
| |
| // LC access control signal broadcast |
| 'lc_ctrl.lc_creator_seed_sw_rw_en' : ['otp_ctrl.lc_creator_seed_sw_rw_en', |
| 'flash_ctrl.lc_creator_seed_sw_rw_en'], |
| 'lc_ctrl.lc_owner_seed_sw_rw_en' : ['flash_ctrl.lc_owner_seed_sw_rw_en'], |
| 'lc_ctrl.lc_iso_part_sw_rd_en' : ['flash_ctrl.lc_iso_part_sw_rd_en'], |
| 'lc_ctrl.lc_iso_part_sw_wr_en' : ['flash_ctrl.lc_iso_part_sw_wr_en'], |
| 'lc_ctrl.lc_seed_hw_rd_en' : ['otp_ctrl.lc_seed_hw_rd_en', |
| 'flash_ctrl.lc_seed_hw_rd_en'], |
| } |
| |
| // top is to connect to top net/struct. |
| // It defines the signal in the top and connect from the module, |
| // use of the signal is up to top template |
| 'top': [ |
| 'rstmgr_aon.resets', 'rstmgr_aon.cpu', 'pwrmgr_aon.pwr_cpu', 'clkmgr_aon.clocks', |
| |
| // Xbars |
| 'main.tl_corei', 'main.tl_cored', 'main.tl_dm_sba', 'main.tl_debug_mem' |
| ], |
| |
| // ext is to create port in the top. |
| 'external': { |
| 'adc_ctrl_aon.adc' : 'adc' |
| 'ast.edn' : '', |
| 'ast.lc_dft_en' : '', |
| 'ast.ram_1p_cfg' : 'ram_1p_cfg', |
| 'ast.ram_2p_cfg' : 'ram_2p_cfg', |
| 'ast.rom_cfg' : 'rom_cfg', |
| 'clkmgr_aon.clk_main' : 'clk_main', // clock inputs |
| 'clkmgr_aon.clk_io' : 'clk_io', // clock inputs |
| 'clkmgr_aon.clk_usb' : 'clk_usb', // clock inputs |
| 'clkmgr_aon.clk_aon' : 'clk_aon', // clock inputs |
| 'clkmgr_aon.jitter_en' : 'clk_main_jitter_en', |
| 'clkmgr_aon.ast_clk_byp_req' : 'ast_clk_byp_req', |
| 'clkmgr_aon.ast_clk_byp_ack' : 'ast_clk_byp_ack', |
| 'eflash.flash_bist_enable' : 'flash_bist_enable', |
| 'eflash.flash_power_down_h' : 'flash_power_down_h', |
| 'eflash.flash_power_ready_h' : 'flash_power_ready_h', |
| 'entropy_src.entropy_src_rng' : 'es_rng', |
| 'entropy_src.rng_fips' : 'es_rng_fips', |
| 'peri.tl_ast' : 'ast_tl', |
| 'pinmux_aon.dft_strap_test' : 'dft_strap_test' |
| 'pwrmgr_aon.pwr_ast' : 'pwrmgr_ast', |
| 'otp_ctrl.otp_ast_pwr_seq' : '', |
| 'otp_ctrl.otp_ast_pwr_seq_h' : '', |
| 'sensor_ctrl_aon.ast_alert' : 'sensor_ctrl_ast_alert', |
| 'sensor_ctrl_aon.ast_status' : 'sensor_ctrl_ast_status', |
| 'sensor_ctrl_aon.pinmux2ast' : 'pinmux2ast', |
| 'sensor_ctrl_aon.ast2pinmux' : 'ast2pinmux', |
| 'usbdev.usb_ref_val' : '', |
| 'usbdev.usb_ref_pulse' : '', |
| }, |
| }, |
| |
| debug_mem_base_addr: "0x1A110000", |
| |
| // Crossbars: having a top level crossbar |
| // This version assumes all crossbars are instantiated at the top. |
| // Assume xbar.hjson is located in the same directory of top.hjson |
| xbar: [ |
| { name: "main", |
| clock_srcs: {clk_main_i: "main", clk_fixed_i: "io_div4"}, |
| clock_group: "infra", |
| reset: "sys", |
| reset_connections: {rst_main_ni: "sys", rst_fixed_ni: "sys_io_div4"} |
| }, |
| { name: "peri", |
| clock_srcs: {clk_peri_i: "io_div4"}, |
| clock_group: "infra", |
| reset: "sys_io_div4", |
| reset_connections: {rst_peri_ni: "sys_io_div4"}, |
| } |
| ], |
| |
| // ===== INTERRUPT CTRL ===================================================== |
| |
| // RV_PLIC has two searching algorithm internally to pick the most highest priority interrupt |
| // source. "sequential" is smaller but slower, "matrix" is larger but faster. |
| // Choose depends on the criteria. Currently it is set to "matrix" to meet FPGA timing @ 50MHz |
| |
| // ===== ALERT HANDLER ====================================================== |
| |
| // TODO: need to overhaul this datastructure. |
| pinmux: { |
| |
| // Total number of Multiplexed I/O |
| // All the input/outputs from IPs are muxed in pinmux, and it has # of I/O |
| // talks to the outside of top_earlgrey. |
| // This field will be replaced to the length of PAD if padctrl is defined |
| num_mio: 44 |
| |
| // Dedicated IO modules. The in/out ports of the modules below are connected |
| // to TOP IO port through PADS directly. It bypasses PINMUX multiplexers |
| dio_modules: [ |
| { name: "spi_device", pad: ["ChC[0..5]"] }, |
| { name: "spi_host0", pad: ["ChB[0..5]"] }, |
| { name: "usbdev", pad: ["ChA[0..8]"] }, |
| ], |
| |
| // Multiplexing IO modules. The in/out ports of the modules below are |
| // connected through PINMUX, which gives controllability of the connection |
| // between the modules and the IO PADS. |
| // If `mio_modules` aren't defined, it uses all remaining modules from |
| // module list except defined in `dio_modules`. |
| mio_modules: ["gpio", "uart0", "uart1", "uart2", "uart3", |
| "i2c0", "i2c1", "i2c2", "pattgen", "spi_host1", |
| "flash_ctrl", "sensor_ctrl_aon"] |
| |
| // If any module isn't defined in above two lists, its inputs will be tied |
| // to 0, and the output/OE signals will be floating (or connected to |
| // unused signal). `rv_plic` is special module, shouldn't be defined here. |
| nc_modules: ["rv_timer", "hmac"] |
| |
| // Number of wakeup detectors to instantiate, and bitwidth for the wakeup |
| // counters. Note that all MIO pad inputs are connected to the wakeup detectors, |
| // and there is no way to disable this. DIO inputs on the other hand are by |
| // default not connected. |
| // TODO: need to add mechanism to mark them as wakeup pins. |
| num_wkup_detect: 8 |
| wkup_cnt_width: 8 |
| |
| // Below fields are generated. |
| // inputs: [ |
| // { name: "xxx", width: xx }, |
| // ] |
| // outputs: [ |
| // { name: "xxx", width: xx }, |
| // ] |
| // inouts: [ |
| // { name: "xxx", width: xx }, |
| // ] |
| } |
| |
| // TODO: need to overhaul this datastructure. |
| // PADS instantiation |
| // Number of in/outs and the numer of PAD instances doesn't have to be |
| // same. The number given below excludes clock/reset and other necessary |
| // PADS but only defines GPIO pads. |
| padctrl: { |
| attr_default: ["STRONG"], |
| pads: [ |
| { name: "ChA" type: "IO_33V", count: 32 }, // Accessing as ChA[0] .. ChA[31] |
| { name: "ChB" type: "IO_33V", count: 4, attr: ["KEEP", "WEAK"]}, |
| { name: "ChC" type: "IO_33V", count: 4, attr: ["KEEP", "STRONG"]}, |
| ] |
| } |
| |
| } |