From 68da51094d7ba37302a9fa7d6ae14a643915d5cf Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 13 Jul 2024 00:45:30 +0200 Subject: [PATCH 1/8] Fix hjson files that shall not use commas (#552) Some hjson files in X-HEEP use trailing comma after a "quoteless string" which isn't valid in the standard (https://hjson.github.io/syntax.html): > Do not add commas or comments as they would become part of the string. This includes "barewords" such as `active: low,` but also (surprisingly) hexadecimal values such as `address: 0x10000000,` which is technically also interpreted as a string and not an integer value. (`42,`, `true,`, `false,` and `"string",` are OK though.) This fixes issue #552. It also deprecates certain workarounds in the code that were using `.split(',')` or `.strip(',')` to address this issue (but the issue was really that the file format was wrong, not that the parser failed). --- .github/workflows/simulate.yml | 2 +- docs/source/How_to/IntegratePeripheral.md | 6 +- mcu_cfg.hjson | 108 +++++++++++----------- mcu_cfg_minimal.hjson | 108 +++++++++++----------- pad_cfg.hjson | 4 +- 5 files changed, 114 insertions(+), 114 deletions(-) diff --git a/.github/workflows/simulate.yml b/.github/workflows/simulate.yml index 8e11e0851..7626d9ef7 100644 --- a/.github/workflows/simulate.yml +++ b/.github/workflows/simulate.yml @@ -17,6 +17,6 @@ jobs: conda activate core-v-mini-mcu make clean-all sed 's/is_included: "no",/is_included: "yes",/' -i mcu_cfg.hjson - sed 's/num_channels: 0x1,/num_channels: 0x4,/' -i mcu_cfg.hjson + sed 's/num_channels: 0x1$/num_channels: 0x4/' -i mcu_cfg.hjson make mcu-gen MEMORY_BANKS=6 python3 .github/workflows/sim-apps-job/test_apps.py \ No newline at end of file diff --git a/docs/source/How_to/IntegratePeripheral.md b/docs/source/How_to/IntegratePeripheral.md index f39bdbd19..36e61bf59 100644 --- a/docs/source/How_to/IntegratePeripheral.md +++ b/docs/source/How_to/IntegratePeripheral.md @@ -153,14 +153,14 @@ II. The module must be instantiated in the peripheral subsystem: - hw/ip//.vlt ``` -8. The MCU configuration (mcu_cfg.json) must be adapted: +8. The MCU configuration (mcu_cfg.hjson) must be adapted: ```diff peripherals: { <...> + : { -+ offset: 0x00060000, -+ length: 0x00010000, ++ offset: 0x00060000 ++ length: 0x00010000 + }, }, ``` diff --git a/mcu_cfg.hjson b/mcu_cfg.hjson index df55d1609..8d8fa3625 100644 --- a/mcu_cfg.hjson +++ b/mcu_cfg.hjson @@ -8,122 +8,122 @@ cpu_type: cv32e20 linker_script: { - stack_size: 0x800, - heap_size: 0x800, + stack_size: 0x800 + heap_size: 0x800 } debug: { - address: 0x10000000, - length: 0x00100000, + address: 0x10000000 + length: 0x00100000 }, ao_peripherals: { - address: 0x20000000, - length: 0x00100000, + address: 0x20000000 + length: 0x00100000 soc_ctrl: { - offset: 0x00000000, - length: 0x00010000, + offset: 0x00000000 + length: 0x00010000 path: "./hw/ip/soc_ctrl/data/soc_ctrl.hjson" }, bootrom: { - offset: 0x00010000, - length: 0x00010000, + offset: 0x00010000 + length: 0x00010000 }, spi_flash: { - offset: 0x00020000, - length: 0x00008000, + offset: 0x00020000 + length: 0x00008000 }, spi_memio: { - offset: 0x00028000, - length: 0x00008000, + offset: 0x00028000 + length: 0x00008000 }, dma: { - offset: 0x00030000, - length: 0x00010000, - ch_length: 0x100, - num_channels: 0x1, + offset: 0x00030000 + length: 0x00010000 + ch_length: 0x100 + num_channels: 0x1 path: "./hw/ip/dma/data/dma.hjson" }, power_manager: { - offset: 0x00040000, - length: 0x00010000, + offset: 0x00040000 + length: 0x00010000 path: "./hw/ip/power_manager/data/power_manager.hjson" }, rv_timer_ao: { - offset: 0x00050000, - length: 0x00010000, + offset: 0x00050000 + length: 0x00010000 }, fast_intr_ctrl: { - offset: 0x00060000, - length: 0x00010000, + offset: 0x00060000 + length: 0x00010000 path: "./hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson" }, ext_peripheral: { - offset: 0x00070000, - length: 0x00010000, + offset: 0x00070000 + length: 0x00010000 }, pad_control: { - offset: 0x00080000, - length: 0x00010000, + offset: 0x00080000 + length: 0x00010000 }, gpio_ao: { - offset: 0x00090000, - length: 0x00010000, + offset: 0x00090000 + length: 0x00010000 }, uart: { - offset: 0x000A0000, - length: 0x00010000, + offset: 0x000A0000 + length: 0x00010000 path: "./hw/vendor/lowrisc_opentitan/hw/ip/uart/data/uart.hjson" }, }, peripherals: { - address: 0x30000000, - length: 0x00100000, + address: 0x30000000 + length: 0x00100000 rv_plic: { - offset: 0x00000000, - length: 0x00010000, + offset: 0x00000000 + length: 0x00010000 is_included: "yes", path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" }, spi_host: { - offset: 0x00010000, - length: 0x00010000, + offset: 0x00010000 + length: 0x00010000 is_included: "yes", path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" }, gpio: { - offset: 0x00020000, - length: 0x00010000, + offset: 0x00020000 + length: 0x00010000 is_included: "yes", path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" }, i2c: { - offset: 0x00030000, - length: 0x00010000, + offset: 0x00030000 + length: 0x00010000 is_included: "yes", path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" }, rv_timer: { - offset: 0x00040000, - length: 0x00010000, + offset: 0x00040000 + length: 0x00010000 is_included: "yes", path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" }, spi2: { - offset: 0x00050000, - length: 0x00010000, + offset: 0x00050000 + length: 0x00010000 is_included: "yes", }, pdm2pcm: { - offset: 0x00060000, - length: 0x00010000, + offset: 0x00060000 + length: 0x00010000 is_included: "no", path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" }, i2s: { - offset: 0x00070000, - length: 0x00010000, + offset: 0x00070000 + length: 0x00010000 is_included: "yes", path: "./hw/ip/i2s/data/i2s.hjson" }, @@ -131,13 +131,13 @@ }, flash_mem: { - address: 0x40000000, - length: 0x01000000, + address: 0x40000000 + length: 0x01000000 }, ext_slaves: { - address: 0xF0000000, - length: 0x01000000, + address: 0xF0000000 + length: 0x01000000 }, interrupts: { diff --git a/mcu_cfg_minimal.hjson b/mcu_cfg_minimal.hjson index 0be257d7b..9bce98d3e 100644 --- a/mcu_cfg_minimal.hjson +++ b/mcu_cfg_minimal.hjson @@ -8,135 +8,135 @@ cpu_type: cv32e20 linker_script: { - stack_size: 0x800, - heap_size: 0x800, + stack_size: 0x800 + heap_size: 0x800 } debug: { - address: 0x10000000, - length: 0x00100000, + address: 0x10000000 + length: 0x00100000 }, ao_peripherals: { - address: 0x20000000, - length: 0x00100000, + address: 0x20000000 + length: 0x00100000 soc_ctrl: { - offset: 0x00000000, - length: 0x00010000, + offset: 0x00000000 + length: 0x00010000 path: "./hw/ip/soc_ctrl/data/soc_ctrl.hjson" }, bootrom: { - offset: 0x00010000, - length: 0x00010000, + offset: 0x00010000 + length: 0x00010000 }, spi_flash: { - offset: 0x00020000, - length: 0x00008000, + offset: 0x00020000 + length: 0x00008000 }, spi_memio: { - offset: 0x00028000, - length: 0x00008000, + offset: 0x00028000 + length: 0x00008000 }, dma: { - offset: 0x00030000, - length: 0x00010000, - ch_length: 0x100, - num_channels: 0x1, + offset: 0x00030000 + length: 0x00010000 + ch_length: 0x100 + num_channels: 0x1 path: "./hw/ip/dma/data/dma.hjson" }, power_manager: { - offset: 0x00040000, - length: 0x00010000, + offset: 0x00040000 + length: 0x00010000 path: "./hw/ip/power_manager/data/power_manager.hjson" }, rv_timer_ao: { - offset: 0x00050000, - length: 0x00010000, + offset: 0x00050000 + length: 0x00010000 }, fast_intr_ctrl: { - offset: 0x00060000, - length: 0x00010000, + offset: 0x00060000 + length: 0x00010000 path: "./hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson" }, ext_peripheral: { - offset: 0x00070000, - length: 0x00010000, + offset: 0x00070000 + length: 0x00010000 }, pad_control: { - offset: 0x00080000, - length: 0x00010000, + offset: 0x00080000 + length: 0x00010000 }, gpio_ao: { - offset: 0x00090000, - length: 0x00010000, + offset: 0x00090000 + length: 0x00010000 }, uart: { - offset: 0x000A0000, - length: 0x00010000, + offset: 0x000A0000 + length: 0x00010000 path: "./hw/vendor/lowrisc_opentitan/hw/ip/uart/data/uart.hjson" }, }, peripherals: { - address: 0x30000000, - length: 0x00100000, + address: 0x30000000 + length: 0x00100000 rv_plic: { - offset: 0x00000000, - length: 0x00010000, + offset: 0x00000000 + length: 0x00010000 is_included: "no", path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" }, spi_host: { - offset: 0x00010000, - length: 0x00010000, + offset: 0x00010000 + length: 0x00010000 is_included: "no", path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" }, gpio: { - offset: 0x00020000, - length: 0x00010000, + offset: 0x00020000 + length: 0x00010000 is_included: "no", path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" }, i2c: { - offset: 0x00030000, - length: 0x00010000, + offset: 0x00030000 + length: 0x00010000 is_included: "no", path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" }, rv_timer: { - offset: 0x00040000, - length: 0x00010000, + offset: 0x00040000 + length: 0x00010000 is_included: "no", path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" }, spi2: { - offset: 0x00050000, - length: 0x00010000, + offset: 0x00050000 + length: 0x00010000 is_included: "no", }, pdm2pcm: { - offset: 0x00060000, - length: 0x00010000, + offset: 0x00060000 + length: 0x00010000 is_included: "no", path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" }, i2s: { - offset: 0x00070000, - length: 0x00010000, + offset: 0x00070000 + length: 0x00010000 is_included: "no", path: "./hw/ip/i2s/data/i2s.hjson" }, }, flash_mem: { - address: 0x40000000, - length: 0x01000000, + address: 0x40000000 + length: 0x01000000 }, ext_slaves: { - address: 0xF0000000, - length: 0x01000000, + address: 0xF0000000 + length: 0x01000000 }, interrupts: { diff --git a/pad_cfg.hjson b/pad_cfg.hjson index 1cfa8c798..0bfa7ae88 100644 --- a/pad_cfg.hjson +++ b/pad_cfg.hjson @@ -33,7 +33,7 @@ }, rst: { num: 1, - active: low, + active: low driven_manually: True type: input }, @@ -55,7 +55,7 @@ }, jtag_trst: { num: 1, - active: low, + active: low type: input }, jtag_tdi: { From a97912283981329cd4b6cdcb8ad37c709e7cbd79 Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 01:50:14 +0200 Subject: [PATCH 2/8] Remove trailing commas in documentation --- docs/source/Configuration/Configuration.rst | 2 +- docs/source/How_to/IntegratePeripheral.md | 20 ++++++++++---------- docs/source/How_to/eXtendingHEEP.md | 10 +++++----- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/source/Configuration/Configuration.rst b/docs/source/Configuration/Configuration.rst index c18a4e26b..d1bad2bbd 100644 --- a/docs/source/Configuration/Configuration.rst +++ b/docs/source/Configuration/Configuration.rst @@ -92,7 +92,7 @@ The other name can be used in code with a `.xheep_` prefix, like in `example_mat { ram_address: 0 - bus_type: "onetoM", + bus_type: "onetoM" ram_banks: { code_and_data: { num: 2 diff --git a/docs/source/How_to/IntegratePeripheral.md b/docs/source/How_to/IntegratePeripheral.md index 36e61bf59..ea3dafaf0 100644 --- a/docs/source/How_to/IntegratePeripheral.md +++ b/docs/source/How_to/IntegratePeripheral.md @@ -85,17 +85,17 @@ b. The module `xilinx_core_v_mini_mcu_wrapper` should be modified as follows: + inout logic [X-1:0] gpio_io, ``` -c. The pads configuration (pad_cfg.json) must be adapted as well: +c. The pads configuration (pad_cfg.hjson) must be adapted as well: ```diff gpio: { -- num: , -+ num: , - num_offset: 0, #first gpio is gpio0 +- num: ++ num: + num_offset: 0 # first gpio is gpio0 type: inout }, + pdm2pcm_pdm: { -+ num: 1, ++ num: 1 + type: inout + mux: { + : { @@ -237,9 +237,9 @@ reg2hw.register.q // Data to be read from a register ``` { window: { - name: "RX_WINDOW_NAME", - items: "1", - validbits: "32", + name: "RX_WINDOW_NAME" + items: "1" + validbits: "32" desc: '''Window purpose description''' swaccess: "ro" } @@ -314,10 +314,10 @@ If the GPIOs usage has changed, the testbench must be adapted as follows: ``` ## Add an interrupt -You must register the interrupt in the MCU configuration `mcu_cfg.json`. +You must register the interrupt in the MCU configuration `mcu_cfg.hjson`. ```diff interrupts: { - number: 64, // Do not change this number! + number: 64 // Do not change this number! list: { ... + : diff --git a/docs/source/How_to/eXtendingHEEP.md b/docs/source/How_to/eXtendingHEEP.md index 0f875a5f1..6094f88be 100644 --- a/docs/source/How_to/eXtendingHEEP.md +++ b/docs/source/How_to/eXtendingHEEP.md @@ -38,15 +38,15 @@ In order to vendorize `X-HEEP` create inside your repository's base directory (` // SPDX-License-Identifier: Apache-2.0 WITH SHL-2.1 { - name: "esl_epfl_x_heep", - target_dir: "esl_epfl_x_heep", + name: "esl_epfl_x_heep" + target_dir: "esl_epfl_x_heep" upstream: { - url: "https://github.com/esl-epfl/x-heep.git", - rev: "main", + url: "https://github.com/esl-epfl/x-heep.git" + rev: "main" }, - patch_dir: "patches/esl_epfl_x_heep", + patch_dir: "patches/esl_epfl_x_heep" exclude_from_upstream: [ ".github", From 4d005319ff365aa9ace4b8fa3640bf9deef8e222 Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 02:25:53 +0200 Subject: [PATCH 3/8] Remove trailing commas followed by comments --- hw/ip/dma/data/dma.hjson | 18 +++++++++--------- mcu_cfg.hjson | 2 +- mcu_cfg_minimal.hjson | 2 +- pad_cfg.hjson | 6 +++--- 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index 58f6d3a03..a1f6f9c0d 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -37,7 +37,7 @@ desc: "Number of bytes to copy from, defined with respect to the first dimension - Once a value is written, the copy starts", swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse + hwqe: "true" // enable `qe` latched signal of software write pulse // Dimensioned to 16 bits to allow for 64kB transfers on 1D fields: [ { bits: "15:0", name: "SIZE", desc: "DMA counter D1 and start" } @@ -47,7 +47,7 @@ desc: "Number of bytes to copy from, defined with respect to the second dimension", swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse + hwqe: "true" // enable `qe` latched signal of software write pulse // Dimensioned to 16 bits to allow for 64kB transfers on 2D fields: [ { bits: "15:0", name: "SIZE", desc: "DMA counter D2" } @@ -58,7 +58,7 @@ swaccess: "ro", hwaccess: "hrw", hwext: "true", - hwre: "true", // enable `re` latched signal of software read pulse + hwre: "true" // enable `re` latched signal of software read pulse resval: 1, fields: [ { bits: "0", name: "READY", desc: "Transaction is done"}, @@ -218,7 +218,7 @@ desc: '''Set the top padding''', swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse: used to trigger the padding + hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding resval: 0, fields: [ { bits: "5:0", name: "PAD", desc: "Top margin padding (2D)"} @@ -228,7 +228,7 @@ desc: '''Set the bottom padding''', swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse: used to trigger the padding + hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding resval: 0, fields: [ { bits: "5:0", name: "PAD", desc: "Bottom margin padding (2D)"} @@ -238,7 +238,7 @@ desc: '''Set the right padding''', swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse: used to trigger the padding + hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding resval: 0, fields: [ { bits: "5:0", name: "PAD", desc: "Right margin padding (1D/2D)"} @@ -248,7 +248,7 @@ desc: '''Set the left padding''', swaccess: "rw", hwaccess: "hro", - hwqe: "true", // enable `qe` latched signal of software write pulse: used to trigger the padding + hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding resval: 0, fields: [ { bits: "5:0", name: "PAD", desc: "Left margin padding (1D/2D)"} @@ -289,7 +289,7 @@ swaccess: "ro", hwaccess: "hrw", hwext: "true", - hwre: "true", // latched signal of software write pulse + hwre: "true" // latched signal of software write pulse resval: 0, fields: [ { bits: "0", name: "FLAG", desc: "Set for transaction done interrupt" } @@ -300,7 +300,7 @@ swaccess: "ro", hwaccess: "hrw", hwext: "true", - hwre: "true", // latched signal of software write pulse + hwre: "true" // latched signal of software write pulse resval: 0, fields: [ { bits: "0", name: "FLAG", desc: "Set for window done interrupt" } diff --git a/mcu_cfg.hjson b/mcu_cfg.hjson index 8d8fa3625..7e05f8e3b 100644 --- a/mcu_cfg.hjson +++ b/mcu_cfg.hjson @@ -141,7 +141,7 @@ }, interrupts: { - number: 64, // Do not change this number! + number: 64 // Do not change this number! list: { // First one is always zero null_intr: 0, diff --git a/mcu_cfg_minimal.hjson b/mcu_cfg_minimal.hjson index 9bce98d3e..374df1df3 100644 --- a/mcu_cfg_minimal.hjson +++ b/mcu_cfg_minimal.hjson @@ -140,7 +140,7 @@ }, interrupts: { - number: 64, // Do not change this number! + number: 64 // Do not change this number! list: { // First one is always zero null_intr: 0, diff --git a/pad_cfg.hjson b/pad_cfg.hjson index 0bfa7ae88..955334453 100644 --- a/pad_cfg.hjson +++ b/pad_cfg.hjson @@ -21,7 +21,7 @@ // attributes: { // bits: 7:0 // resval: 0x3 -// }, +// } { @@ -80,7 +80,7 @@ }, gpio: { num: 18, - num_offset: 0, #first gpio is gpio0 + num_offset: 0 # first gpio is gpio0 type: inout }, spi_flash_sck: { @@ -88,7 +88,7 @@ type: inout }, spi_flash_cs: { - num: 2, #carefull, the x-heep uses the CS from the spi pkg, change it + num: 2 # careful, the x-heep uses the CS from the spi pkg, change it type: inout }, spi_flash_sd: { From 741c4414823cc51b2cb6175692b588cfd12bd2b6 Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 01:57:37 +0200 Subject: [PATCH 4/8] Remove trailing commas in `key: value,` cases --- configs/ci.hjson | 2 +- configs/example_interleaved.hjson | 2 +- configs/general.hjson | 2 +- configs/testall.hjson | 2 +- hw/ip/dma/data/dma.hjson | 178 +++++++++--------- .../fast_intr_ctrl/data/fast_intr_ctrl.hjson | 22 +-- hw/ip/i2s/data/i2s.hjson | 24 +-- hw/ip/obi_spimemio/data/obi_spimemio.hjson | 16 +- hw/ip/pdm2pcm/data/pdm2pcm.hjson | 6 +- hw/ip/soc_ctrl/data/soc_ctrl.hjson | 52 ++--- hw/ip_examples/ams/data/ams.hjson | 16 +- mcu_cfg.hjson | 120 ++++++------ mcu_cfg_minimal.hjson | 120 ++++++------ pad_cfg.hjson | 64 +++---- 14 files changed, 313 insertions(+), 313 deletions(-) diff --git a/configs/ci.hjson b/configs/ci.hjson index 51a278b7f..e58979e6f 100644 --- a/configs/ci.hjson +++ b/configs/ci.hjson @@ -1,5 +1,5 @@ { - bus_type: "onetoM", + bus_type: "onetoM" ram_banks: { code_and_data: { num: 6 diff --git a/configs/example_interleaved.hjson b/configs/example_interleaved.hjson index e831d7978..a143addf6 100644 --- a/configs/example_interleaved.hjson +++ b/configs/example_interleaved.hjson @@ -1,5 +1,5 @@ { - bus_type: "NtoM", + bus_type: "NtoM" ram_banks: { code_and_data: { sizes: 64 diff --git a/configs/general.hjson b/configs/general.hjson index d3465c500..8d385ee88 100644 --- a/configs/general.hjson +++ b/configs/general.hjson @@ -1,6 +1,6 @@ { ram_address: 0 - bus_type: "onetoM", + bus_type: "onetoM" ram_banks: { code_and_data: { num: 2 diff --git a/configs/testall.hjson b/configs/testall.hjson index 36828dc81..dfbaa38ed 100644 --- a/configs/testall.hjson +++ b/configs/testall.hjson @@ -1,5 +1,5 @@ { - bus_type: "onetoM", + bus_type: "onetoM" ram_banks: { code_and_data: { num: 3 diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index a1f6f9c0d..bb5d35921 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -3,40 +3,40 @@ // SPDX-License-Identifier: Apache-2.0 { name: "dma", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" registers: [ { name: "SRC_PTR", - desc: "Input data pointer (word aligned)", - swaccess: "rw", - hwaccess: "hro", + desc: "Input data pointer (word aligned)" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "31:0", name: "PTR_IN", desc: "Input data pointer (word aligned)" } ] }, { name: "DST_PTR", - desc: "Output data pointer (word aligned)", - swaccess: "rw", - hwaccess: "hro", + desc: "Output data pointer (word aligned)" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "31:0", name: "PTR_OUT", desc: "Output data pointer (word aligned)" } ] }, { name: "ADDR_PTR", - desc: "Addess data pointer (word aligned)", - swaccess: "rw", - hwaccess: "hro", + desc: "Addess data pointer (word aligned)" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "31:0", name: "PTR_ADDR", desc: "Address data pointer (word aligned) - used only in Address mode" } ] }, { name: "SIZE_D1", - desc: "Number of bytes to copy from, defined with respect to the first dimension - Once a value is written, the copy starts", - swaccess: "rw", - hwaccess: "hro", + desc: "Number of bytes to copy from, defined with respect to the first dimension - Once a value is written, the copy starts" + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse // Dimensioned to 16 bits to allow for 64kB transfers on 1D fields: [ @@ -44,9 +44,9 @@ ] }, { name: "SIZE_D2", - desc: "Number of bytes to copy from, defined with respect to the second dimension", - swaccess: "rw", - hwaccess: "hro", + desc: "Number of bytes to copy from, defined with respect to the second dimension" + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse // Dimensioned to 16 bits to allow for 64kB transfers on 2D fields: [ @@ -55,62 +55,62 @@ }, { name: "STATUS", desc: '''Status bits are set to one if a given event occurred''', - swaccess: "ro", - hwaccess: "hrw", - hwext: "true", + swaccess: "ro" + hwaccess: "hrw" + hwext: "true" hwre: "true" // enable `re` latched signal of software read pulse - resval: 1, + resval: 1 fields: [ { bits: "0", name: "READY", desc: "Transaction is done"}, { bits: "1", name: "WINDOW_DONE", desc: "set if DMA is copying second half"}, ] }, { name: "SRC_PTR_INC_D1", - desc: "Increment the D1 source pointer every time a word is copied", - swaccess: "rw", - hwaccess: "hro", + desc: "Increment the D1 source pointer every time a word is copied" + swaccess: "rw" + hwaccess: "hro" // Dimensioned to allow a maximum of a 15 element stride for a data_type_word case fields: [ { bits: "5:0", name: "INC", - desc: "Source pointer d1 increment", + desc: "Source pointer d1 increment" resval:4 } ] }, { name: "SRC_PTR_INC_D2", - desc: "Increment the D2 source pointer every time a word is copied", - swaccess: "rw", - hwaccess: "hro", + desc: "Increment the D2 source pointer every time a word is copied" + swaccess: "rw" + hwaccess: "hro" // Dimensioned to allow a maximum of 15 element stride for a data_type_word fields: [ { bits: "22:0", name: "INC", - desc: "Source pointer d2 increment", + desc: "Source pointer d2 increment" resval:4 } ] }, { name: "DST_PTR_INC_D1", - desc: "Increment the D1 destination pointer every time a word is copied", - swaccess: "rw", - hwaccess: "hro", + desc: "Increment the D1 destination pointer every time a word is copied" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "5:0", name: "INC", - desc: "Destination pointer d1 increment", + desc: "Destination pointer d1 increment" resval:4 } ] }, { name: "DST_PTR_INC_D2", - desc: "Increment the D2 destination pointer every time a word is copied", - swaccess: "rw", - hwaccess: "hro", + desc: "Increment the D2 destination pointer every time a word is copied" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "22:0", name: "INC", - desc: "Destination pointer d2 increment", + desc: "Destination pointer d2 increment" resval:4 } ] @@ -119,9 +119,9 @@ desc: '''The DMA will wait for the signal connected to the selected trigger_slots to be high on the read and write side respectivly''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "15:0", name: "RX_TRIGGER_SLOT", desc: "Slot selection mask" @@ -133,12 +133,12 @@ }, { name: "SRC_DATA_TYPE", desc: '''Width/type of the source data to transfer''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "1:0", name: "DATA_TYPE", - desc: "Data type", + desc: "Data type" enum: [ { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"}, { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"}, @@ -150,12 +150,12 @@ }, { name: "DST_DATA_TYPE", desc: '''Width/type of the destination data to transfer''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "1:0", name: "DATA_TYPE", - desc: "Data type", + desc: "Data type" enum: [ { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"}, { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"}, @@ -166,14 +166,14 @@ ] }, { - name: "SIGN_EXT", + name: "SIGN_EXT" desc: '''Is the data to be sign extended? (Checked only if the dst data type is wider than the src data type)''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "0", name: "SIGNED", - desc: "Extend the sign to the destination data", + desc: "Extend the sign to the destination data" enum: [ { value: "0", name: "NO_EXTEND", desc: "Does not extend the sign"}, { value: "1", name: "EXTEND", desc: "Extends the sign"}, @@ -183,11 +183,11 @@ }, { name: "MODE", desc: '''Set the operational mode of the DMA''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "1:0", name: "MODE", - desc: "DMA operation mode", + desc: "DMA operation mode" enum: [ { value: "0", name: "LINEAR_MODE", desc: "Transfers data linearly"}, { value: "1", name: "CIRCULAR_MODE", desc: "Transfers data in circular mode"}, @@ -198,58 +198,58 @@ }, { name: "DIM_CONFIG", desc: '''Set the dimensionality of the DMA''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "0", name: "DMA_DIM", desc: "DMA transfer dimensionality"} ] }, { name: "DIM_INV", desc: '''DMA dimensionality inversion selector''', - swaccess: "rw", - hwaccess: "hro", - resval: 0, + swaccess: "rw" + hwaccess: "hro" + resval: 0 fields: [ { bits: "0", name: "SEL", desc: "DMA dimensionality inversion, used to perform transposition"} ] }, { name: "PAD_TOP", desc: '''Set the top padding''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding - resval: 0, + resval: 0 fields: [ { bits: "5:0", name: "PAD", desc: "Top margin padding (2D)"} ] }, { name: "PAD_BOTTOM", desc: '''Set the bottom padding''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding - resval: 0, + resval: 0 fields: [ { bits: "5:0", name: "PAD", desc: "Bottom margin padding (2D)"} ] }, { name: "PAD_RIGHT", desc: '''Set the right padding''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding - resval: 0, + resval: 0 fields: [ { bits: "5:0", name: "PAD", desc: "Right margin padding (1D/2D)"} ] }, { name: "PAD_LEFT", desc: '''Set the left padding''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding - resval: 0, + resval: 0 fields: [ { bits: "5:0", name: "PAD", desc: "Left margin padding (1D/2D)"} ] @@ -257,8 +257,8 @@ { name: "WINDOW_SIZE", desc: '''Will trigger a every "WINDOW_SIZE" writes Set to 0 to disable.''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "12:0", name: "WINDOW_SIZE", desc: ""} ] @@ -266,10 +266,10 @@ { name: "WINDOW_COUNT", desc: '''Number of times the end of the window was reached since the beginning. Reset at start''', - swaccess: "ro", + swaccess: "ro" // hwext: "true", - hwaccess: "hrw", - resval: 0, + hwaccess: "hrw" + resval: 0 fields: [ { bits: "7:0", name: "WINDOW_COUNT", desc: "Number of windows transferred in the transaction" } ] @@ -277,8 +277,8 @@ { name: "INTERRUPT_EN", desc: '''Interrupt Enable Register (Only the interrupt with the lowest id will be triggered)''', - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "0", name: "TRANSACTION_DONE", desc: "Enables transaction done interrupt" } { bits: "1", name: "WINDOW_DONE", desc: "Enables window done interrupt" } @@ -286,22 +286,22 @@ }, { name: "TRANSACTION_IFR", desc: '''Interrupt Flag Register for transactions''', - swaccess: "ro", - hwaccess: "hrw", - hwext: "true", + swaccess: "ro" + hwaccess: "hrw" + hwext: "true" hwre: "true" // latched signal of software write pulse - resval: 0, + resval: 0 fields: [ { bits: "0", name: "FLAG", desc: "Set for transaction done interrupt" } ] }, { name: "WINDOW_IFR", desc: '''Interrupt Flag Register for windows''', - swaccess: "ro", - hwaccess: "hrw", - hwext: "true", + swaccess: "ro" + hwaccess: "hrw" + hwext: "true" hwre: "true" // latched signal of software write pulse - resval: 0, + resval: 0 fields: [ { bits: "0", name: "FLAG", desc: "Set for window done interrupt" } ] diff --git a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson index 1bb0642b2..a3164e050 100644 --- a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson +++ b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson @@ -2,37 +2,37 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 { name: "fast_intr_ctrl", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" registers: [ { name: "FAST_INTR_PENDING", - desc: "Pending fast interrupt", + desc: "Pending fast interrupt" resval: "0x00000000" - swaccess: "ro", - hwaccess: "hrw", + swaccess: "ro" + hwaccess: "hrw" fields: [ { bits: "14:0", name: "FAST_INTR_PENDING", desc: "Pending Fast Interrupt Reg" } ] } { name: "FAST_INTR_CLEAR", - desc: "Clear fast interrupt", + desc: "Clear fast interrupt" resval: "0x00000000" - swaccess: "rw", - hwaccess: "hrw", + swaccess: "rw" + hwaccess: "hrw" fields: [ { bits: "14:0", name: "FAST_INTR_CLEAR", desc: "Clear Fast Interrupt" } ] } { name: "FAST_INTR_ENABLE", - desc: "Enable fast interrupt", + desc: "Enable fast interrupt" resval: "0x7fff" - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "14:0", name: "FAST_INTR_ENABLE", desc: "Enable fast interrupt" } ] diff --git a/hw/ip/i2s/data/i2s.hjson b/hw/ip/i2s/data/i2s.hjson index 95b1e3be4..cbf3635b0 100644 --- a/hw/ip/i2s/data/i2s.hjson +++ b/hw/ip/i2s/data/i2s.hjson @@ -3,25 +3,25 @@ // SPDX-License-Identifier: Apache-2.0 { name: "i2s", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" param_list: [ { name: "MaxWordWidth", desc: '''Defines the maximal word width''', - type: "int", + type: "int" default: "32" } { name: "ClkDividerWidth", desc: '''Bits available for the clock divider''', - type: "int", + type: "int" default: "16" } { name: "WatermarkWidth", desc: '''Bits available for the watermark''', - type: "int", + type: "int" default: "16" } ] @@ -30,7 +30,7 @@ desc: '''Event-related interrupts.''' } ], - no_auto_intr_regs: "true", + no_auto_intr_regs: "true" registers: [ @@ -45,7 +45,7 @@ { bits: "0", name: "EN", desc: "Enable I2s - CLK Domain" } { bits: "1", name: "EN_WS", desc: "Enable word select generation" } { bits: "3:2", name: "EN_RX", desc: "Enable rx channels" - resval: "0", + resval: "0" enum: [ { value: "0", name: "DISABLED", desc: "Disable I2s" }, { value: "1", name: "ONLY_LEFT", desc: "Enable left channel" }, @@ -58,8 +58,8 @@ { bits: "6", name: "RESET_WATERMARK", desc: "reset watermark counter", hwaccess: "hrw"} { bits: "7", name: "EN_IO", desc: "connects the peripheral to the IOs" } { bits: "9:8", name: "DATA_WIDTH", - desc: "Bytes per sample", - resval: "3", + desc: "Bytes per sample" + resval: "3" enum: [ { value: "0", name: "8_BITS", desc: "8 bits" }, { value: "1", name: "16_BITS", desc: "16 bits" }, @@ -68,8 +68,8 @@ ] } { bits: "10", name: "RX_START_CHANNEL", - desc: "Channel (left/right) of first sample - alternating afterwards.", - resval: "0", + desc: "Channel (left/right) of first sample - alternating afterwards." + resval: "0" enum: [ { value: "0", name: "LEFT_FIRST", desc: "Start left channel first (default for WAVE)"}, { value: "1", name: "RIGHT_FIRST", desc: "Start right channel first"}, @@ -96,7 +96,7 @@ desc: "Control register" swaccess: "rw" hwaccess: "hro" - resval: 4, + resval: 4 fields: [ { bits: "15:0", name: "COUNT", desc: "Index at which clock divide." } ] diff --git a/hw/ip/obi_spimemio/data/obi_spimemio.hjson b/hw/ip/obi_spimemio/data/obi_spimemio.hjson index c4c0424f1..f2c11c3ed 100644 --- a/hw/ip/obi_spimemio/data/obi_spimemio.hjson +++ b/hw/ip/obi_spimemio/data/obi_spimemio.hjson @@ -2,25 +2,25 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 { name: "obi_spimemio", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" registers: [ { name: "START_SPIMEM", - desc: "Start SPIMEM", - swaccess: "rw", - hwaccess: "hro", + desc: "Start SPIMEM" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "0", name: "START_SPIMEM", desc: "Start YosysHQ SPIMEM Reg" } ] } { name: "CFG_SPIMEM", - desc: "Cfg SPIMEM", + desc: "Cfg SPIMEM" //none as we use it only to generate the SW - swaccess: "none", - hwaccess: "none", + swaccess: "none" + hwaccess: "none" fields: [ { bits: "31:0", name: "CFG_SPIMEM", desc: "Cfg YosysHQ SPIMEM Reg" } ] diff --git a/hw/ip/pdm2pcm/data/pdm2pcm.hjson b/hw/ip/pdm2pcm/data/pdm2pcm.hjson index 0aa97ab20..ae1c0d972 100644 --- a/hw/ip/pdm2pcm/data/pdm2pcm.hjson +++ b/hw/ip/pdm2pcm/data/pdm2pcm.hjson @@ -297,9 +297,9 @@ ] } { window: { - name: "RXDATA", - items: "1", - validbits: "32", + name: "RXDATA" + items: "1" + validbits: "32" desc: '''PCM Receive data ''' swaccess: "ro" diff --git a/hw/ip/soc_ctrl/data/soc_ctrl.hjson b/hw/ip/soc_ctrl/data/soc_ctrl.hjson index 827514b65..b9d0208a0 100644 --- a/hw/ip/soc_ctrl/data/soc_ctrl.hjson +++ b/hw/ip/soc_ctrl/data/soc_ctrl.hjson @@ -2,76 +2,76 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 { name: "soc_ctrl", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" registers: [ { name: "EXIT_VALID", - desc: "Exit Valid - Used to write exit valid bit", - swaccess: "rw", - hwaccess: "hro", + desc: "Exit Valid - Used to write exit valid bit" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "0", name: "EXIT_VALID", desc: "Exit Valid Reg" } ] }, { name: "EXIT_VALUE", - desc: "Exit Value - Used to write exit value register", - swaccess: "rw", - hwaccess: "hro", + desc: "Exit Value - Used to write exit value register" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "31:0", name: "EXIT_VALUE", desc: "Exit Value Reg" } ] } { name: "BOOT_SELECT", - desc: "Boot Select Value - Used to decide whether to boot from JTAG or FLASH", - swaccess: "ro", - hwaccess: "hrw", + desc: "Boot Select Value - Used to decide whether to boot from JTAG or FLASH" + swaccess: "ro" + hwaccess: "hrw" fields: [ { bits: "0", name: "BOOT_SELECT", desc: "Boot Select Reg" } ] } { name: "BOOT_EXIT_LOOP", - desc: "Boot Exit Loop Value - Set externally (e.g. JTAG, TESTBENCH, or another MASTER) to make the CPU jump to the main function entry", - swaccess: "rw", - hwaccess: "hrw", + desc: "Boot Exit Loop Value - Set externally (e.g. JTAG, TESTBENCH, or another MASTER) to make the CPU jump to the main function entry" + swaccess: "rw" + hwaccess: "hrw" fields: [ { bits: "0", name: "BOOT_EXIT_LOOP", desc: "Boot Exit Reg" } ] } { name: "BOOT_ADDRESS", - desc: "Boot Address Value - Used in the boot rom or power-on-reset functions", + desc: "Boot Address Value - Used in the boot rom or power-on-reset functions" resval: "0x00000180" - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "31:0", name: "BOOT_ADDRESS", desc: "Boot Address Reg" } ] } { name: "USE_SPIMEMIO", - desc: "Spi Module Select Value - Used to decide whether to use the SPI from Yosys or OpenTitan", + desc: "Spi Module Select Value - Used to decide whether to use the SPI from Yosys or OpenTitan" resval: "0x1" - swaccess: "rw", - hwaccess: "hrw", + swaccess: "rw" + hwaccess: "hrw" fields: [ { bits: "0", name: "USE_SPIMEMIO", desc: "Spi Select Reg" } ] } { name: "ENABLE_SPI_SEL", - desc: "Enable Spi module selection from software", + desc: "Enable Spi module selection from software" resval: "0x0" - swaccess: "rw", - hwaccess: "hro", + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "0", name: "ENABLE_SPI_SEL", desc: "Enable Spi Select Reg" } ] } { name: "SYSTEM_FREQUENCY_HZ", - desc: "System Frequency Value - Used to know and set at which frequency the system is running (in Hz)", + desc: "System Frequency Value - Used to know and set at which frequency the system is running (in Hz)" resval: "0x1" - swaccess: "rw", - hwaccess: "none", + swaccess: "rw" + hwaccess: "none" fields: [ { bits: "31:0", name: "SYSTEM_FREQUENCY_HZ", desc: "Contains the value in Hz of the frequency the system is running" } ] diff --git a/hw/ip_examples/ams/data/ams.hjson b/hw/ip_examples/ams/data/ams.hjson index 38dad9dcb..28b4266be 100644 --- a/hw/ip_examples/ams/data/ams.hjson +++ b/hw/ip_examples/ams/data/ams.hjson @@ -3,24 +3,24 @@ // SPDX-License-Identifier: Apache-2.0 { name: "ams", - clock_primary: "clk_i", + clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], - regwidth: "32", + regwidth: "32" registers: [ { name: "SEL", - desc: "Select the ADC threshold value (20%, 40%, 60%, 80% of VDD)", - swaccess: "rw", - hwaccess: "hro", + desc: "Select the ADC threshold value (20%, 40%, 60%, 80% of VDD)" + swaccess: "rw" + hwaccess: "hro" fields: [ { bits: "1:0", name:"VALUE", desc: "Set the ADC threshold value" } ] }, { name: "GET", - desc: "Get the ADC output", - swaccess: "ro", - hwaccess: "hrw", + desc: "Get the ADC output" + swaccess: "ro" + hwaccess: "hrw" fields: [ { bits: "0", name:"VALUE", desc: "Get the ADC output" } ] diff --git a/mcu_cfg.hjson b/mcu_cfg.hjson index 7e05f8e3b..f0939f298 100644 --- a/mcu_cfg.hjson +++ b/mcu_cfg.hjson @@ -83,48 +83,48 @@ rv_plic: { offset: 0x00000000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" }, spi_host: { offset: 0x00010000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" }, gpio: { offset: 0x00020000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" }, i2c: { offset: 0x00030000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" }, rv_timer: { offset: 0x00040000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" }, spi2: { offset: 0x00050000 length: 0x00010000 - is_included: "yes", + is_included: "yes" }, pdm2pcm: { offset: 0x00060000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" }, i2s: { offset: 0x00070000 length: 0x00010000 - is_included: "yes", + is_included: "yes" path: "./hw/ip/i2s/data/i2s.hjson" }, @@ -144,58 +144,58 @@ number: 64 // Do not change this number! list: { // First one is always zero - null_intr: 0, - uart_intr_tx_watermark: 1, - uart_intr_rx_watermark: 2, - uart_intr_tx_empty: 3, - uart_intr_rx_overflow: 4, - uart_intr_rx_frame_err: 5, - uart_intr_rx_break_err: 6, - uart_intr_rx_timeout: 7, - uart_intr_rx_parity_err: 8, - gpio_intr_8: 9, - gpio_intr_9: 10, - gpio_intr_10: 11, - gpio_intr_11: 12, - gpio_intr_12: 13, - gpio_intr_13: 14, - gpio_intr_14: 15, - gpio_intr_15: 16, - gpio_intr_16: 17, - gpio_intr_17: 18, - gpio_intr_18: 19, - gpio_intr_19: 20, - gpio_intr_20: 21, - gpio_intr_21: 22, - gpio_intr_22: 23, - gpio_intr_23: 24, - gpio_intr_24: 25, - gpio_intr_25: 26, - gpio_intr_26: 27, - gpio_intr_27: 28, - gpio_intr_28: 29, - gpio_intr_29: 30, - gpio_intr_30: 31, - gpio_intr_31: 32, - intr_fmt_watermark: 33, - intr_rx_watermark: 34, - intr_fmt_overflow: 35, - intr_rx_overflow: 36, - intr_nak: 37, - intr_scl_interference: 38, - intr_sda_interference: 39, - intr_stretch_timeout: 40, - intr_sda_unstable: 41, - intr_trans_complete: 42, - intr_tx_empty: 43, - intr_tx_nonempty: 44, - intr_tx_overflow: 45, - intr_acq_overflow: 46, - intr_ack_stop: 47, - intr_host_timeout: 48, - spi2_intr_event: 49, - i2s_intr_event: 50, - dma_window_intr: 51, + null_intr: 0 + uart_intr_tx_watermark: 1 + uart_intr_rx_watermark: 2 + uart_intr_tx_empty: 3 + uart_intr_rx_overflow: 4 + uart_intr_rx_frame_err: 5 + uart_intr_rx_break_err: 6 + uart_intr_rx_timeout: 7 + uart_intr_rx_parity_err: 8 + gpio_intr_8: 9 + gpio_intr_9: 10 + gpio_intr_10: 11 + gpio_intr_11: 12 + gpio_intr_12: 13 + gpio_intr_13: 14 + gpio_intr_14: 15 + gpio_intr_15: 16 + gpio_intr_16: 17 + gpio_intr_17: 18 + gpio_intr_18: 19 + gpio_intr_19: 20 + gpio_intr_20: 21 + gpio_intr_21: 22 + gpio_intr_22: 23 + gpio_intr_23: 24 + gpio_intr_24: 25 + gpio_intr_25: 26 + gpio_intr_26: 27 + gpio_intr_27: 28 + gpio_intr_28: 29 + gpio_intr_29: 30 + gpio_intr_30: 31 + gpio_intr_31: 32 + intr_fmt_watermark: 33 + intr_rx_watermark: 34 + intr_fmt_overflow: 35 + intr_rx_overflow: 36 + intr_nak: 37 + intr_scl_interference: 38 + intr_sda_interference: 39 + intr_stretch_timeout: 40 + intr_sda_unstable: 41 + intr_trans_complete: 42 + intr_tx_empty: 43 + intr_tx_nonempty: 44 + intr_tx_overflow: 45 + intr_acq_overflow: 46 + intr_ack_stop: 47 + intr_host_timeout: 48 + spi2_intr_event: 49 + i2s_intr_event: 50 + dma_window_intr: 51 } } } diff --git a/mcu_cfg_minimal.hjson b/mcu_cfg_minimal.hjson index 374df1df3..44f3b1f5f 100644 --- a/mcu_cfg_minimal.hjson +++ b/mcu_cfg_minimal.hjson @@ -83,48 +83,48 @@ rv_plic: { offset: 0x00000000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" }, spi_host: { offset: 0x00010000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" }, gpio: { offset: 0x00020000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" }, i2c: { offset: 0x00030000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" }, rv_timer: { offset: 0x00040000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" }, spi2: { offset: 0x00050000 length: 0x00010000 - is_included: "no", + is_included: "no" }, pdm2pcm: { offset: 0x00060000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" }, i2s: { offset: 0x00070000 length: 0x00010000 - is_included: "no", + is_included: "no" path: "./hw/ip/i2s/data/i2s.hjson" }, }, @@ -143,58 +143,58 @@ number: 64 // Do not change this number! list: { // First one is always zero - null_intr: 0, - uart_intr_tx_watermark: 1, - uart_intr_rx_watermark: 2, - uart_intr_tx_empty: 3, - uart_intr_rx_overflow: 4, - uart_intr_rx_frame_err: 5, - uart_intr_rx_break_err: 6, - uart_intr_rx_timeout: 7, - uart_intr_rx_parity_err: 8, - gpio_intr_8: 9, - gpio_intr_9: 10, - gpio_intr_10: 11, - gpio_intr_11: 12, - gpio_intr_12: 13, - gpio_intr_13: 14, - gpio_intr_14: 15, - gpio_intr_15: 16, - gpio_intr_16: 17, - gpio_intr_17: 18, - gpio_intr_18: 19, - gpio_intr_19: 20, - gpio_intr_20: 21, - gpio_intr_21: 22, - gpio_intr_22: 23, - gpio_intr_23: 24, - gpio_intr_24: 25, - gpio_intr_25: 26, - gpio_intr_26: 27, - gpio_intr_27: 28, - gpio_intr_28: 29, - gpio_intr_29: 30, - gpio_intr_30: 31, - gpio_intr_31: 32, - intr_fmt_watermark: 33, - intr_rx_watermark: 34, - intr_fmt_overflow: 35, - intr_rx_overflow: 36, - intr_nak: 37, - intr_scl_interference: 38, - intr_sda_interference: 39, - intr_stretch_timeout: 40, - intr_sda_unstable: 41, - intr_trans_complete: 42, - intr_tx_empty: 43, - intr_tx_nonempty: 44, - intr_tx_overflow: 45, - intr_acq_overflow: 46, - intr_ack_stop: 47, - intr_host_timeout: 48, - spi2_intr_event: 49, - i2s_intr_event: 50, - dma_window_intr: 51, + null_intr: 0 + uart_intr_tx_watermark: 1 + uart_intr_rx_watermark: 2 + uart_intr_tx_empty: 3 + uart_intr_rx_overflow: 4 + uart_intr_rx_frame_err: 5 + uart_intr_rx_break_err: 6 + uart_intr_rx_timeout: 7 + uart_intr_rx_parity_err: 8 + gpio_intr_8: 9 + gpio_intr_9: 10 + gpio_intr_10: 11 + gpio_intr_11: 12 + gpio_intr_12: 13 + gpio_intr_13: 14 + gpio_intr_14: 15 + gpio_intr_15: 16 + gpio_intr_16: 17 + gpio_intr_17: 18 + gpio_intr_18: 19 + gpio_intr_19: 20 + gpio_intr_20: 21 + gpio_intr_21: 22 + gpio_intr_22: 23 + gpio_intr_23: 24 + gpio_intr_24: 25 + gpio_intr_25: 26 + gpio_intr_26: 27 + gpio_intr_27: 28 + gpio_intr_28: 29 + gpio_intr_29: 30 + gpio_intr_30: 31 + gpio_intr_31: 32 + intr_fmt_watermark: 33 + intr_rx_watermark: 34 + intr_fmt_overflow: 35 + intr_rx_overflow: 36 + intr_nak: 37 + intr_scl_interference: 38 + intr_sda_interference: 39 + intr_stretch_timeout: 40 + intr_sda_unstable: 41 + intr_trans_complete: 42 + intr_tx_empty: 43 + intr_tx_nonempty: 44 + intr_tx_overflow: 45 + intr_acq_overflow: 46 + intr_ack_stop: 47 + intr_host_timeout: 48 + spi2_intr_event: 49 + i2s_intr_event: 50 + dma_window_intr: 51 } } } diff --git a/pad_cfg.hjson b/pad_cfg.hjson index 955334453..54a0389e7 100644 --- a/pad_cfg.hjson +++ b/pad_cfg.hjson @@ -28,63 +28,63 @@ pads: { clk: { - num: 1, + num: 1 type: input }, rst: { - num: 1, + num: 1 active: low driven_manually: True type: input }, boot_select: { - num: 1, + num: 1 type: input }, execute_from_flash: { - num: 1, + num: 1 type: input }, jtag_tck: { - num: 1, + num: 1 type: input }, jtag_tms: { - num: 1, + num: 1 type: input }, jtag_trst: { - num: 1, + num: 1 active: low type: input }, jtag_tdi: { - num: 1, + num: 1 type: input }, jtag_tdo: { - num: 1, + num: 1 type: output }, uart_rx: { - num: 1, + num: 1 type: input }, uart_tx: { - num: 1, + num: 1 type: output }, exit_valid: { - num: 1, + num: 1 type: output }, gpio: { - num: 18, + num: 18 num_offset: 0 # first gpio is gpio0 type: inout }, spi_flash_sck: { - num: 1, + num: 1 type: inout }, spi_flash_cs: { @@ -92,24 +92,24 @@ type: inout }, spi_flash_sd: { - num: 4, + num: 4 type: inout }, spi_sck: { - num: 1, + num: 1 type: inout }, spi_cs: { - num: 2, + num: 2 type: inout }, spi_sd: { - num: 4, + num: 4 type: inout }, pdm2pcm_pdm: { - num: 1, + num: 1 type: inout mux: { pdm2pcm_pdm: { @@ -121,7 +121,7 @@ } }, pdm2pcm_clk: { - num: 1, + num: 1 type: inout mux: { pdm2pcm_clk: { @@ -133,7 +133,7 @@ } }, i2s_sck: { - num: 1, + num: 1 type: inout mux: { i2s_sck: { @@ -145,7 +145,7 @@ } }, i2s_ws: { - num: 1, + num: 1 type: inout mux: { i2s_ws: { @@ -157,7 +157,7 @@ } }, i2s_sd: { - num: 1, + num: 1 type: inout mux: { i2s_sd: { @@ -169,7 +169,7 @@ } }, spi2_cs_0: { - num: 1, + num: 1 type: inout mux: { spi2_cs_0: { @@ -181,7 +181,7 @@ } }, spi2_cs_1: { - num: 1, + num: 1 type: inout mux: { spi2_cs_1: { @@ -193,7 +193,7 @@ }, }, spi2_sck: { - num: 1, + num: 1 type: inout mux: { spi2_sck: { @@ -205,7 +205,7 @@ } }, spi2_sd_0: { - num: 1, + num: 1 type: inout mux: { spi2_sd_0: { @@ -217,7 +217,7 @@ } }, spi2_sd_1: { - num: 1, + num: 1 type: inout mux: { spi2_sd_1: { @@ -229,7 +229,7 @@ } }, spi2_sd_2: { - num: 1, + num: 1 type: inout mux: { spi2_sd_2: { @@ -241,7 +241,7 @@ } }, spi2_sd_3: { - num: 1, + num: 1 type: inout mux: { spi2_sd_3: { @@ -253,7 +253,7 @@ } }, i2c_scl: { - num: 1, + num: 1 type: inout mux: { i2c_scl: { @@ -265,7 +265,7 @@ } }, i2c_sda: { - num: 1, + num: 1 type: inout mux: { i2c_sda: { From 79c9bc24a619abed1efe1109888f8c6b37a52b08 Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 02:10:48 +0200 Subject: [PATCH 5/8] Remove trailing commas in `{ key: value,` --- hw/ip/dma/data/dma.hjson | 88 +++++++++---------- .../fast_intr_ctrl/data/fast_intr_ctrl.hjson | 8 +- hw/ip/i2s/data/i2s.hjson | 34 +++---- hw/ip/obi_spimemio/data/obi_spimemio.hjson | 6 +- hw/ip/soc_ctrl/data/soc_ctrl.hjson | 18 ++-- hw/ip_examples/ams/data/ams.hjson | 6 +- 6 files changed, 80 insertions(+), 80 deletions(-) diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index bb5d35921..2f9fd9b27 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "dma", +{ name: "dma" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" registers: [ - { name: "SRC_PTR", + { name: "SRC_PTR" desc: "Input data pointer (word aligned)" swaccess: "rw" hwaccess: "hro" @@ -17,7 +17,7 @@ { bits: "31:0", name: "PTR_IN", desc: "Input data pointer (word aligned)" } ] }, - { name: "DST_PTR", + { name: "DST_PTR" desc: "Output data pointer (word aligned)" swaccess: "rw" hwaccess: "hro" @@ -25,7 +25,7 @@ { bits: "31:0", name: "PTR_OUT", desc: "Output data pointer (word aligned)" } ] }, - { name: "ADDR_PTR", + { name: "ADDR_PTR" desc: "Addess data pointer (word aligned)" swaccess: "rw" hwaccess: "hro" @@ -33,7 +33,7 @@ { bits: "31:0", name: "PTR_ADDR", desc: "Address data pointer (word aligned) - used only in Address mode" } ] }, - { name: "SIZE_D1", + { name: "SIZE_D1" desc: "Number of bytes to copy from, defined with respect to the first dimension - Once a value is written, the copy starts" swaccess: "rw" hwaccess: "hro" @@ -43,7 +43,7 @@ { bits: "15:0", name: "SIZE", desc: "DMA counter D1 and start" } ] }, - { name: "SIZE_D2", + { name: "SIZE_D2" desc: "Number of bytes to copy from, defined with respect to the second dimension" swaccess: "rw" hwaccess: "hro" @@ -53,7 +53,7 @@ { bits: "15:0", name: "SIZE", desc: "DMA counter D2" } ] }, - { name: "STATUS", + { name: "STATUS" desc: '''Status bits are set to one if a given event occurred''', swaccess: "ro" hwaccess: "hrw" @@ -61,11 +61,11 @@ hwre: "true" // enable `re` latched signal of software read pulse resval: 1 fields: [ - { bits: "0", name: "READY", desc: "Transaction is done"}, - { bits: "1", name: "WINDOW_DONE", desc: "set if DMA is copying second half"}, + { bits: "0", name: "READY", desc: "Transaction is done"} + { bits: "1", name: "WINDOW_DONE", desc: "set if DMA is copying second half"} ] }, - { name: "SRC_PTR_INC_D1", + { name: "SRC_PTR_INC_D1" desc: "Increment the D1 source pointer every time a word is copied" swaccess: "rw" hwaccess: "hro" @@ -78,7 +78,7 @@ } ] }, - { name: "SRC_PTR_INC_D2", + { name: "SRC_PTR_INC_D2" desc: "Increment the D2 source pointer every time a word is copied" swaccess: "rw" hwaccess: "hro" @@ -91,7 +91,7 @@ } ] }, - { name: "DST_PTR_INC_D1", + { name: "DST_PTR_INC_D1" desc: "Increment the D1 destination pointer every time a word is copied" swaccess: "rw" hwaccess: "hro" @@ -103,7 +103,7 @@ } ] }, - { name: "DST_PTR_INC_D2", + { name: "DST_PTR_INC_D2" desc: "Increment the D2 destination pointer every time a word is copied" swaccess: "rw" hwaccess: "hro" @@ -115,7 +115,7 @@ } ] }, - { name: "SLOT", + { name: "SLOT" desc: '''The DMA will wait for the signal connected to the selected trigger_slots to be high on the read and write side respectivly''', @@ -123,15 +123,15 @@ hwaccess: "hro" resval: 0 fields: [ - { bits: "15:0", name: "RX_TRIGGER_SLOT", + { bits: "15:0", name: "RX_TRIGGER_SLOT" desc: "Slot selection mask" }, - { bits: "31:16", name: "TX_TRIGGER_SLOT", + { bits: "31:16", name: "TX_TRIGGER_SLOT" desc: "Slot selection mask" } ] }, - { name: "SRC_DATA_TYPE", + { name: "SRC_DATA_TYPE" desc: '''Width/type of the source data to transfer''', swaccess: "rw" hwaccess: "hro" @@ -140,15 +140,15 @@ { bits: "1:0", name: "DATA_TYPE", desc: "Data type" enum: [ - { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"}, - { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"}, - { value: "2", name: "DMA_8BIT_WORD" , desc: "Transfers 8 bits"}, - { value: "3", name: "DMA_8BIT_WORD_2",desc: "Transfers 8 bits"}, + { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"} + { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"} + { value: "2", name: "DMA_8BIT_WORD" , desc: "Transfers 8 bits"} + { value: "3", name: "DMA_8BIT_WORD_2",desc: "Transfers 8 bits"} ] } ] }, - { name: "DST_DATA_TYPE", + { name: "DST_DATA_TYPE" desc: '''Width/type of the destination data to transfer''', swaccess: "rw" hwaccess: "hro" @@ -157,10 +157,10 @@ { bits: "1:0", name: "DATA_TYPE", desc: "Data type" enum: [ - { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"}, - { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"}, - { value: "2", name: "DMA_8BIT_WORD" , desc: "Transfers 8 bits"}, - { value: "3", name: "DMA_8BIT_WORD_2",desc: "Transfers 8 bits"}, + { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"} + { value: "1", name: "DMA_16BIT_WORD", desc: "Transfers 16 bits"} + { value: "2", name: "DMA_8BIT_WORD" , desc: "Transfers 8 bits"} + { value: "3", name: "DMA_8BIT_WORD_2",desc: "Transfers 8 bits"} ] } ] @@ -175,28 +175,28 @@ { bits: "0", name: "SIGNED", desc: "Extend the sign to the destination data" enum: [ - { value: "0", name: "NO_EXTEND", desc: "Does not extend the sign"}, - { value: "1", name: "EXTEND", desc: "Extends the sign"}, + { value: "0", name: "NO_EXTEND", desc: "Does not extend the sign"} + { value: "1", name: "EXTEND", desc: "Extends the sign"} ] } ] }, - { name: "MODE", + { name: "MODE" desc: '''Set the operational mode of the DMA''', swaccess: "rw" hwaccess: "hro" fields: [ - { bits: "1:0", name: "MODE", + { bits: "1:0", name: "MODE" desc: "DMA operation mode" enum: [ - { value: "0", name: "LINEAR_MODE", desc: "Transfers data linearly"}, - { value: "1", name: "CIRCULAR_MODE", desc: "Transfers data in circular mode"}, - { value: "2", name: "ADDRESS_MODE" , desc: "Transfers data using as destination address the data from ADD_PTR"}, + { value: "0", name: "LINEAR_MODE", desc: "Transfers data linearly"} + { value: "1", name: "CIRCULAR_MODE", desc: "Transfers data in circular mode"} + { value: "2", name: "ADDRESS_MODE" , desc: "Transfers data using as destination address the data from ADD_PTR"} ] } ] }, - { name: "DIM_CONFIG", + { name: "DIM_CONFIG" desc: '''Set the dimensionality of the DMA''', swaccess: "rw" hwaccess: "hro" @@ -205,7 +205,7 @@ { bits: "0", name: "DMA_DIM", desc: "DMA transfer dimensionality"} ] }, - { name: "DIM_INV", + { name: "DIM_INV" desc: '''DMA dimensionality inversion selector''', swaccess: "rw" hwaccess: "hro" @@ -214,7 +214,7 @@ { bits: "0", name: "SEL", desc: "DMA dimensionality inversion, used to perform transposition"} ] }, - { name: "PAD_TOP", + { name: "PAD_TOP" desc: '''Set the top padding''', swaccess: "rw" hwaccess: "hro" @@ -224,7 +224,7 @@ { bits: "5:0", name: "PAD", desc: "Top margin padding (2D)"} ] }, - { name: "PAD_BOTTOM", + { name: "PAD_BOTTOM" desc: '''Set the bottom padding''', swaccess: "rw" hwaccess: "hro" @@ -234,7 +234,7 @@ { bits: "5:0", name: "PAD", desc: "Bottom margin padding (2D)"} ] }, - { name: "PAD_RIGHT", + { name: "PAD_RIGHT" desc: '''Set the right padding''', swaccess: "rw" hwaccess: "hro" @@ -244,7 +244,7 @@ { bits: "5:0", name: "PAD", desc: "Right margin padding (1D/2D)"} ] }, - { name: "PAD_LEFT", + { name: "PAD_LEFT" desc: '''Set the left padding''', swaccess: "rw" hwaccess: "hro" @@ -254,7 +254,7 @@ { bits: "5:0", name: "PAD", desc: "Left margin padding (1D/2D)"} ] }, - { name: "WINDOW_SIZE", + { name: "WINDOW_SIZE" desc: '''Will trigger a every "WINDOW_SIZE" writes Set to 0 to disable.''', swaccess: "rw" @@ -263,7 +263,7 @@ { bits: "12:0", name: "WINDOW_SIZE", desc: ""} ] }, - { name: "WINDOW_COUNT", + { name: "WINDOW_COUNT" desc: '''Number of times the end of the window was reached since the beginning. Reset at start''', swaccess: "ro" @@ -274,7 +274,7 @@ { bits: "7:0", name: "WINDOW_COUNT", desc: "Number of windows transferred in the transaction" } ] }, - { name: "INTERRUPT_EN", + { name: "INTERRUPT_EN" desc: '''Interrupt Enable Register (Only the interrupt with the lowest id will be triggered)''', swaccess: "rw" @@ -284,7 +284,7 @@ { bits: "1", name: "WINDOW_DONE", desc: "Enables window done interrupt" } ] }, - { name: "TRANSACTION_IFR", + { name: "TRANSACTION_IFR" desc: '''Interrupt Flag Register for transactions''', swaccess: "ro" hwaccess: "hrw" @@ -295,7 +295,7 @@ { bits: "0", name: "FLAG", desc: "Set for transaction done interrupt" } ] }, - { name: "WINDOW_IFR", + { name: "WINDOW_IFR" desc: '''Interrupt Flag Register for windows''', swaccess: "ro" hwaccess: "hrw" diff --git a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson index a3164e050..567bf5d38 100644 --- a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson +++ b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson @@ -1,14 +1,14 @@ // Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "fast_intr_ctrl", +{ name: "fast_intr_ctrl" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" registers: [ - { name: "FAST_INTR_PENDING", + { name: "FAST_INTR_PENDING" desc: "Pending fast interrupt" resval: "0x00000000" swaccess: "ro" @@ -18,7 +18,7 @@ ] } - { name: "FAST_INTR_CLEAR", + { name: "FAST_INTR_CLEAR" desc: "Clear fast interrupt" resval: "0x00000000" swaccess: "rw" @@ -28,7 +28,7 @@ ] } - { name: "FAST_INTR_ENABLE", + { name: "FAST_INTR_ENABLE" desc: "Enable fast interrupt" resval: "0x7fff" swaccess: "rw" diff --git a/hw/ip/i2s/data/i2s.hjson b/hw/ip/i2s/data/i2s.hjson index cbf3635b0..bb09af5b3 100644 --- a/hw/ip/i2s/data/i2s.hjson +++ b/hw/ip/i2s/data/i2s.hjson @@ -2,31 +2,31 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "i2s", +{ name: "i2s" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" param_list: [ - { name: "MaxWordWidth", + { name: "MaxWordWidth" desc: '''Defines the maximal word width''', type: "int" default: "32" } - { name: "ClkDividerWidth", + { name: "ClkDividerWidth" desc: '''Bits available for the clock divider''', type: "int" default: "16" } - { name: "WatermarkWidth", + { name: "WatermarkWidth" desc: '''Bits available for the watermark''', type: "int" default: "16" } ] interrupt_list: [ - { name: "i2s_event", + { name: "i2s_event" desc: '''Event-related interrupts.''' } ], @@ -47,32 +47,32 @@ { bits: "3:2", name: "EN_RX", desc: "Enable rx channels" resval: "0" enum: [ - { value: "0", name: "DISABLED", desc: "Disable I2s" }, - { value: "1", name: "ONLY_LEFT", desc: "Enable left channel" }, - { value: "2", name: "ONLY_RIGHT", desc: "Enable right channel" }, - { value: "3", name: "BOTH_CHANNELS", desc: "Enable both channels" }, + { value: "0", name: "DISABLED", desc: "Disable I2s" } + { value: "1", name: "ONLY_LEFT", desc: "Enable left channel" } + { value: "2", name: "ONLY_RIGHT", desc: "Enable right channel" } + { value: "3", name: "BOTH_CHANNELS", desc: "Enable both channels" } ] } { bits: "4", name: "INTR_EN", desc: "enable watermark interrupt" } { bits: "5", name: "EN_WATERMARK", desc: "en watermark counter" } { bits: "6", name: "RESET_WATERMARK", desc: "reset watermark counter", hwaccess: "hrw"} { bits: "7", name: "EN_IO", desc: "connects the peripheral to the IOs" } - { bits: "9:8", name: "DATA_WIDTH", + { bits: "9:8", name: "DATA_WIDTH" desc: "Bytes per sample" resval: "3" enum: [ - { value: "0", name: "8_BITS", desc: "8 bits" }, - { value: "1", name: "16_BITS", desc: "16 bits" }, - { value: "2", name: "24_BITS", desc: "24 bits" }, + { value: "0", name: "8_BITS", desc: "8 bits" } + { value: "1", name: "16_BITS", desc: "16 bits" } + { value: "2", name: "24_BITS", desc: "24 bits" } { value: "3", name: "32_BITS", desc: "32 bits" } ] } - { bits: "10", name: "RX_START_CHANNEL", + { bits: "10", name: "RX_START_CHANNEL" desc: "Channel (left/right) of first sample - alternating afterwards." resval: "0" enum: [ - { value: "0", name: "LEFT_FIRST", desc: "Start left channel first (default for WAVE)"}, - { value: "1", name: "RIGHT_FIRST", desc: "Start right channel first"}, + { value: "0", name: "LEFT_FIRST", desc: "Start left channel first (default for WAVE)"} + { value: "1", name: "RIGHT_FIRST", desc: "Start right channel first"} ] } { bits: "11", name: "RESET_RX_OVERFLOW", desc: "reset rx overflow", hwaccess: "hrw"} @@ -102,7 +102,7 @@ ] } // RX DATA - { name: "RXDATA", + { name: "RXDATA" desc: "I2s Receive data" swaccess: "ro" hwaccess: "hrw" diff --git a/hw/ip/obi_spimemio/data/obi_spimemio.hjson b/hw/ip/obi_spimemio/data/obi_spimemio.hjson index f2c11c3ed..1b2dbac4a 100644 --- a/hw/ip/obi_spimemio/data/obi_spimemio.hjson +++ b/hw/ip/obi_spimemio/data/obi_spimemio.hjson @@ -1,14 +1,14 @@ // Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "obi_spimemio", +{ name: "obi_spimemio" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" registers: [ - { name: "START_SPIMEM", + { name: "START_SPIMEM" desc: "Start SPIMEM" swaccess: "rw" hwaccess: "hro" @@ -16,7 +16,7 @@ { bits: "0", name: "START_SPIMEM", desc: "Start YosysHQ SPIMEM Reg" } ] } - { name: "CFG_SPIMEM", + { name: "CFG_SPIMEM" desc: "Cfg SPIMEM" //none as we use it only to generate the SW swaccess: "none" diff --git a/hw/ip/soc_ctrl/data/soc_ctrl.hjson b/hw/ip/soc_ctrl/data/soc_ctrl.hjson index b9d0208a0..a12d77f71 100644 --- a/hw/ip/soc_ctrl/data/soc_ctrl.hjson +++ b/hw/ip/soc_ctrl/data/soc_ctrl.hjson @@ -1,14 +1,14 @@ // Copyright lowRISC contributors. // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "soc_ctrl", +{ name: "soc_ctrl" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" registers: [ - { name: "EXIT_VALID", + { name: "EXIT_VALID" desc: "Exit Valid - Used to write exit valid bit" swaccess: "rw" hwaccess: "hro" @@ -16,7 +16,7 @@ { bits: "0", name: "EXIT_VALID", desc: "Exit Valid Reg" } ] }, - { name: "EXIT_VALUE", + { name: "EXIT_VALUE" desc: "Exit Value - Used to write exit value register" swaccess: "rw" hwaccess: "hro" @@ -24,7 +24,7 @@ { bits: "31:0", name: "EXIT_VALUE", desc: "Exit Value Reg" } ] } - { name: "BOOT_SELECT", + { name: "BOOT_SELECT" desc: "Boot Select Value - Used to decide whether to boot from JTAG or FLASH" swaccess: "ro" hwaccess: "hrw" @@ -32,7 +32,7 @@ { bits: "0", name: "BOOT_SELECT", desc: "Boot Select Reg" } ] } - { name: "BOOT_EXIT_LOOP", + { name: "BOOT_EXIT_LOOP" desc: "Boot Exit Loop Value - Set externally (e.g. JTAG, TESTBENCH, or another MASTER) to make the CPU jump to the main function entry" swaccess: "rw" hwaccess: "hrw" @@ -40,7 +40,7 @@ { bits: "0", name: "BOOT_EXIT_LOOP", desc: "Boot Exit Reg" } ] } - { name: "BOOT_ADDRESS", + { name: "BOOT_ADDRESS" desc: "Boot Address Value - Used in the boot rom or power-on-reset functions" resval: "0x00000180" swaccess: "rw" @@ -49,7 +49,7 @@ { bits: "31:0", name: "BOOT_ADDRESS", desc: "Boot Address Reg" } ] } - { name: "USE_SPIMEMIO", + { name: "USE_SPIMEMIO" desc: "Spi Module Select Value - Used to decide whether to use the SPI from Yosys or OpenTitan" resval: "0x1" swaccess: "rw" @@ -58,7 +58,7 @@ { bits: "0", name: "USE_SPIMEMIO", desc: "Spi Select Reg" } ] } - { name: "ENABLE_SPI_SEL", + { name: "ENABLE_SPI_SEL" desc: "Enable Spi module selection from software" resval: "0x0" swaccess: "rw" @@ -67,7 +67,7 @@ { bits: "0", name: "ENABLE_SPI_SEL", desc: "Enable Spi Select Reg" } ] } - { name: "SYSTEM_FREQUENCY_HZ", + { name: "SYSTEM_FREQUENCY_HZ" desc: "System Frequency Value - Used to know and set at which frequency the system is running (in Hz)" resval: "0x1" swaccess: "rw" diff --git a/hw/ip_examples/ams/data/ams.hjson b/hw/ip_examples/ams/data/ams.hjson index 28b4266be..a49bb8b77 100644 --- a/hw/ip_examples/ams/data/ams.hjson +++ b/hw/ip_examples/ams/data/ams.hjson @@ -2,14 +2,14 @@ // Licensed under the Apache License, Version 2.0, see LICENSE for details. // SPDX-License-Identifier: Apache-2.0 -{ name: "ams", +{ name: "ams" clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } ], regwidth: "32" registers: [ - { name: "SEL", + { name: "SEL" desc: "Select the ADC threshold value (20%, 40%, 60%, 80% of VDD)" swaccess: "rw" hwaccess: "hro" @@ -17,7 +17,7 @@ { bits: "1:0", name:"VALUE", desc: "Set the ADC threshold value" } ] }, - { name: "GET", + { name: "GET" desc: "Get the ADC output" swaccess: "ro" hwaccess: "hrw" From 39884029d1977fb063d070d9368184503c9ae8a9 Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 02:14:24 +0200 Subject: [PATCH 6/8] Remove trailing commas in `},` and `],` --- configs/ci.hjson | 2 +- configs/example_interleaved.hjson | 2 +- configs/general.hjson | 2 +- configs/testall.hjson | 2 +- hw/ip/dma/data/dma.hjson | 54 ++++----- .../fast_intr_ctrl/data/fast_intr_ctrl.hjson | 2 +- hw/ip/i2s/data/i2s.hjson | 4 +- hw/ip/obi_spimemio/data/obi_spimemio.hjson | 2 +- hw/ip/soc_ctrl/data/soc_ctrl.hjson | 4 +- hw/ip_examples/ams/data/ams.hjson | 6 +- hw/ip_examples/iffifo/data/iffifo.hjson | 2 +- mcu_cfg.hjson | 50 ++++---- mcu_cfg_minimal.hjson | 50 ++++---- pad_cfg.hjson | 112 +++++++++--------- 14 files changed, 147 insertions(+), 147 deletions(-) diff --git a/configs/ci.hjson b/configs/ci.hjson index e58979e6f..c788643fd 100644 --- a/configs/ci.hjson +++ b/configs/ci.hjson @@ -14,7 +14,7 @@ start: 0 #minimum size for freeRTOS and clang size: 0x00000D800 - }, + } { name: data start: 0x00000D800 diff --git a/configs/example_interleaved.hjson b/configs/example_interleaved.hjson index a143addf6..81f46cda6 100644 --- a/configs/example_interleaved.hjson +++ b/configs/example_interleaved.hjson @@ -31,7 +31,7 @@ start: 0 // minimum size for freeRTOS and clang size: 0x00000C800 - }, + } { name: data start: 0x00000C800 diff --git a/configs/general.hjson b/configs/general.hjson index 8d385ee88..d74ad88e3 100644 --- a/configs/general.hjson +++ b/configs/general.hjson @@ -15,7 +15,7 @@ start: 0 #minimum size for freeRTOS and clang size: 0x00000C800 - }, + } { name: data start: 0x00000C800 diff --git a/configs/testall.hjson b/configs/testall.hjson index dfbaa38ed..97ba92b81 100644 --- a/configs/testall.hjson +++ b/configs/testall.hjson @@ -14,7 +14,7 @@ start: 0 #minimum size for freeRTOS and clang size: 0x00000D800 - }, + } { name: data start: 0x00000D800 diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index 2f9fd9b27..7419785b4 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -6,7 +6,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" registers: [ { name: "SRC_PTR" @@ -16,7 +16,7 @@ fields: [ { bits: "31:0", name: "PTR_IN", desc: "Input data pointer (word aligned)" } ] - }, + } { name: "DST_PTR" desc: "Output data pointer (word aligned)" swaccess: "rw" @@ -24,7 +24,7 @@ fields: [ { bits: "31:0", name: "PTR_OUT", desc: "Output data pointer (word aligned)" } ] - }, + } { name: "ADDR_PTR" desc: "Addess data pointer (word aligned)" swaccess: "rw" @@ -32,7 +32,7 @@ fields: [ { bits: "31:0", name: "PTR_ADDR", desc: "Address data pointer (word aligned) - used only in Address mode" } ] - }, + } { name: "SIZE_D1" desc: "Number of bytes to copy from, defined with respect to the first dimension - Once a value is written, the copy starts" swaccess: "rw" @@ -42,7 +42,7 @@ fields: [ { bits: "15:0", name: "SIZE", desc: "DMA counter D1 and start" } ] - }, + } { name: "SIZE_D2" desc: "Number of bytes to copy from, defined with respect to the second dimension" swaccess: "rw" @@ -52,7 +52,7 @@ fields: [ { bits: "15:0", name: "SIZE", desc: "DMA counter D2" } ] - }, + } { name: "STATUS" desc: '''Status bits are set to one if a given event occurred''', swaccess: "ro" @@ -64,7 +64,7 @@ { bits: "0", name: "READY", desc: "Transaction is done"} { bits: "1", name: "WINDOW_DONE", desc: "set if DMA is copying second half"} ] - }, + } { name: "SRC_PTR_INC_D1" desc: "Increment the D1 source pointer every time a word is copied" swaccess: "rw" @@ -77,7 +77,7 @@ resval:4 } ] - }, + } { name: "SRC_PTR_INC_D2" desc: "Increment the D2 source pointer every time a word is copied" swaccess: "rw" @@ -90,7 +90,7 @@ resval:4 } ] - }, + } { name: "DST_PTR_INC_D1" desc: "Increment the D1 destination pointer every time a word is copied" swaccess: "rw" @@ -102,7 +102,7 @@ resval:4 } ] - }, + } { name: "DST_PTR_INC_D2" desc: "Increment the D2 destination pointer every time a word is copied" swaccess: "rw" @@ -114,7 +114,7 @@ resval:4 } ] - }, + } { name: "SLOT" desc: '''The DMA will wait for the signal connected to the selected trigger_slots to be high @@ -125,12 +125,12 @@ fields: [ { bits: "15:0", name: "RX_TRIGGER_SLOT" desc: "Slot selection mask" - }, + } { bits: "31:16", name: "TX_TRIGGER_SLOT" desc: "Slot selection mask" } ] - }, + } { name: "SRC_DATA_TYPE" desc: '''Width/type of the source data to transfer''', swaccess: "rw" @@ -147,7 +147,7 @@ ] } ] - }, + } { name: "DST_DATA_TYPE" desc: '''Width/type of the destination data to transfer''', swaccess: "rw" @@ -164,7 +164,7 @@ ] } ] - }, + } { name: "SIGN_EXT" desc: '''Is the data to be sign extended? (Checked only if the dst data type is wider than the src data type)''', @@ -180,7 +180,7 @@ ] } ] - }, + } { name: "MODE" desc: '''Set the operational mode of the DMA''', swaccess: "rw" @@ -195,7 +195,7 @@ ] } ] - }, + } { name: "DIM_CONFIG" desc: '''Set the dimensionality of the DMA''', swaccess: "rw" @@ -204,7 +204,7 @@ fields: [ { bits: "0", name: "DMA_DIM", desc: "DMA transfer dimensionality"} ] - }, + } { name: "DIM_INV" desc: '''DMA dimensionality inversion selector''', swaccess: "rw" @@ -213,7 +213,7 @@ fields: [ { bits: "0", name: "SEL", desc: "DMA dimensionality inversion, used to perform transposition"} ] - }, + } { name: "PAD_TOP" desc: '''Set the top padding''', swaccess: "rw" @@ -223,7 +223,7 @@ fields: [ { bits: "5:0", name: "PAD", desc: "Top margin padding (2D)"} ] - }, + } { name: "PAD_BOTTOM" desc: '''Set the bottom padding''', swaccess: "rw" @@ -233,7 +233,7 @@ fields: [ { bits: "5:0", name: "PAD", desc: "Bottom margin padding (2D)"} ] - }, + } { name: "PAD_RIGHT" desc: '''Set the right padding''', swaccess: "rw" @@ -243,7 +243,7 @@ fields: [ { bits: "5:0", name: "PAD", desc: "Right margin padding (1D/2D)"} ] - }, + } { name: "PAD_LEFT" desc: '''Set the left padding''', swaccess: "rw" @@ -253,7 +253,7 @@ fields: [ { bits: "5:0", name: "PAD", desc: "Left margin padding (1D/2D)"} ] - }, + } { name: "WINDOW_SIZE" desc: '''Will trigger a every "WINDOW_SIZE" writes Set to 0 to disable.''', @@ -262,7 +262,7 @@ fields: [ { bits: "12:0", name: "WINDOW_SIZE", desc: ""} ] - }, + } { name: "WINDOW_COUNT" desc: '''Number of times the end of the window was reached since the beginning. Reset at start''', @@ -273,7 +273,7 @@ fields: [ { bits: "7:0", name: "WINDOW_COUNT", desc: "Number of windows transferred in the transaction" } ] - }, + } { name: "INTERRUPT_EN" desc: '''Interrupt Enable Register (Only the interrupt with the lowest id will be triggered)''', @@ -283,7 +283,7 @@ { bits: "0", name: "TRANSACTION_DONE", desc: "Enables transaction done interrupt" } { bits: "1", name: "WINDOW_DONE", desc: "Enables window done interrupt" } ] - }, + } { name: "TRANSACTION_IFR" desc: '''Interrupt Flag Register for transactions''', swaccess: "ro" @@ -294,7 +294,7 @@ fields: [ { bits: "0", name: "FLAG", desc: "Set for transaction done interrupt" } ] - }, + } { name: "WINDOW_IFR" desc: '''Interrupt Flag Register for windows''', swaccess: "ro" diff --git a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson index 567bf5d38..0b961fb75 100644 --- a/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson +++ b/hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson @@ -5,7 +5,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" registers: [ { name: "FAST_INTR_PENDING" diff --git a/hw/ip/i2s/data/i2s.hjson b/hw/ip/i2s/data/i2s.hjson index bb09af5b3..bd06cfae0 100644 --- a/hw/ip/i2s/data/i2s.hjson +++ b/hw/ip/i2s/data/i2s.hjson @@ -6,7 +6,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" param_list: [ { name: "MaxWordWidth" @@ -29,7 +29,7 @@ { name: "i2s_event" desc: '''Event-related interrupts.''' } - ], + ] no_auto_intr_regs: "true" registers: [ diff --git a/hw/ip/obi_spimemio/data/obi_spimemio.hjson b/hw/ip/obi_spimemio/data/obi_spimemio.hjson index 1b2dbac4a..8ea6e0740 100644 --- a/hw/ip/obi_spimemio/data/obi_spimemio.hjson +++ b/hw/ip/obi_spimemio/data/obi_spimemio.hjson @@ -5,7 +5,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" registers: [ { name: "START_SPIMEM" diff --git a/hw/ip/soc_ctrl/data/soc_ctrl.hjson b/hw/ip/soc_ctrl/data/soc_ctrl.hjson index a12d77f71..4f9b1e8c1 100644 --- a/hw/ip/soc_ctrl/data/soc_ctrl.hjson +++ b/hw/ip/soc_ctrl/data/soc_ctrl.hjson @@ -5,7 +5,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" registers: [ { name: "EXIT_VALID" @@ -15,7 +15,7 @@ fields: [ { bits: "0", name: "EXIT_VALID", desc: "Exit Valid Reg" } ] - }, + } { name: "EXIT_VALUE" desc: "Exit Value - Used to write exit value register" swaccess: "rw" diff --git a/hw/ip_examples/ams/data/ams.hjson b/hw/ip_examples/ams/data/ams.hjson index a49bb8b77..20c1294e0 100644 --- a/hw/ip_examples/ams/data/ams.hjson +++ b/hw/ip_examples/ams/data/ams.hjson @@ -6,7 +6,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: "32" registers: [ { name: "SEL" @@ -16,7 +16,7 @@ fields: [ { bits: "1:0", name:"VALUE", desc: "Set the ADC threshold value" } ] - }, + } { name: "GET" desc: "Get the ADC output" swaccess: "ro" @@ -24,7 +24,7 @@ fields: [ { bits: "0", name:"VALUE", desc: "Get the ADC output" } ] - }, + } ] } diff --git a/hw/ip_examples/iffifo/data/iffifo.hjson b/hw/ip_examples/iffifo/data/iffifo.hjson index 919cceaf6..9090e6ea4 100644 --- a/hw/ip_examples/iffifo/data/iffifo.hjson +++ b/hw/ip_examples/iffifo/data/iffifo.hjson @@ -6,7 +6,7 @@ clock_primary: "clk_i" bus_interfaces: [ { protocol: "reg_iface", direction: "device" } - ], + ] regwidth: 32 registers: [ diff --git a/mcu_cfg.hjson b/mcu_cfg.hjson index f0939f298..a5c148897 100644 --- a/mcu_cfg.hjson +++ b/mcu_cfg.hjson @@ -15,7 +15,7 @@ debug: { address: 0x10000000 length: 0x00100000 - }, + } ao_peripherals: { address: 0x20000000 @@ -24,58 +24,58 @@ offset: 0x00000000 length: 0x00010000 path: "./hw/ip/soc_ctrl/data/soc_ctrl.hjson" - }, + } bootrom: { offset: 0x00010000 length: 0x00010000 - }, + } spi_flash: { offset: 0x00020000 length: 0x00008000 - }, + } spi_memio: { offset: 0x00028000 length: 0x00008000 - }, + } dma: { offset: 0x00030000 length: 0x00010000 ch_length: 0x100 num_channels: 0x1 path: "./hw/ip/dma/data/dma.hjson" - }, + } power_manager: { offset: 0x00040000 length: 0x00010000 path: "./hw/ip/power_manager/data/power_manager.hjson" - }, + } rv_timer_ao: { offset: 0x00050000 length: 0x00010000 - }, + } fast_intr_ctrl: { offset: 0x00060000 length: 0x00010000 path: "./hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson" - }, + } ext_peripheral: { offset: 0x00070000 length: 0x00010000 - }, + } pad_control: { offset: 0x00080000 length: 0x00010000 - }, + } gpio_ao: { offset: 0x00090000 length: 0x00010000 - }, + } uart: { offset: 0x000A0000 length: 0x00010000 path: "./hw/vendor/lowrisc_opentitan/hw/ip/uart/data/uart.hjson" - }, - }, + } + } peripherals: { address: 0x30000000 @@ -85,60 +85,60 @@ length: 0x00010000 is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" - }, + } spi_host: { offset: 0x00010000 length: 0x00010000 is_included: "yes" path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" - }, + } gpio: { offset: 0x00020000 length: 0x00010000 is_included: "yes" path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" - }, + } i2c: { offset: 0x00030000 length: 0x00010000 is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" - }, + } rv_timer: { offset: 0x00040000 length: 0x00010000 is_included: "yes" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" - }, + } spi2: { offset: 0x00050000 length: 0x00010000 is_included: "yes" - }, + } pdm2pcm: { offset: 0x00060000 length: 0x00010000 is_included: "no" path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" - }, + } i2s: { offset: 0x00070000 length: 0x00010000 is_included: "yes" path: "./hw/ip/i2s/data/i2s.hjson" - }, + } - }, + } flash_mem: { address: 0x40000000 length: 0x01000000 - }, + } ext_slaves: { address: 0xF0000000 length: 0x01000000 - }, + } interrupts: { number: 64 // Do not change this number! diff --git a/mcu_cfg_minimal.hjson b/mcu_cfg_minimal.hjson index 44f3b1f5f..938f349ba 100644 --- a/mcu_cfg_minimal.hjson +++ b/mcu_cfg_minimal.hjson @@ -15,7 +15,7 @@ debug: { address: 0x10000000 length: 0x00100000 - }, + } ao_peripherals: { address: 0x20000000 @@ -24,58 +24,58 @@ offset: 0x00000000 length: 0x00010000 path: "./hw/ip/soc_ctrl/data/soc_ctrl.hjson" - }, + } bootrom: { offset: 0x00010000 length: 0x00010000 - }, + } spi_flash: { offset: 0x00020000 length: 0x00008000 - }, + } spi_memio: { offset: 0x00028000 length: 0x00008000 - }, + } dma: { offset: 0x00030000 length: 0x00010000 ch_length: 0x100 num_channels: 0x1 path: "./hw/ip/dma/data/dma.hjson" - }, + } power_manager: { offset: 0x00040000 length: 0x00010000 path: "./hw/ip/power_manager/data/power_manager.hjson" - }, + } rv_timer_ao: { offset: 0x00050000 length: 0x00010000 - }, + } fast_intr_ctrl: { offset: 0x00060000 length: 0x00010000 path: "./hw/ip/fast_intr_ctrl/data/fast_intr_ctrl.hjson" - }, + } ext_peripheral: { offset: 0x00070000 length: 0x00010000 - }, + } pad_control: { offset: 0x00080000 length: 0x00010000 - }, + } gpio_ao: { offset: 0x00090000 length: 0x00010000 - }, + } uart: { offset: 0x000A0000 length: 0x00010000 path: "./hw/vendor/lowrisc_opentitan/hw/ip/uart/data/uart.hjson" - }, - }, + } + } peripherals: { address: 0x30000000 @@ -85,59 +85,59 @@ length: 0x00010000 is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_plic/data/rv_plic.hjson" - }, + } spi_host: { offset: 0x00010000 length: 0x00010000 is_included: "no" path: "./hw/vendor/lowrisc_opentitan_spi_host/data/spi_host.hjson" - }, + } gpio: { offset: 0x00020000 length: 0x00010000 is_included: "no" path: "./hw/vendor/pulp_platform_gpio/gpio_regs.hjson" - }, + } i2c: { offset: 0x00030000 length: 0x00010000 is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/i2c/data/i2c.hjson" - }, + } rv_timer: { offset: 0x00040000 length: 0x00010000 is_included: "no" path: "./hw/vendor/lowrisc_opentitan/hw/ip/rv_timer/data/rv_timer.hjson" - }, + } spi2: { offset: 0x00050000 length: 0x00010000 is_included: "no" - }, + } pdm2pcm: { offset: 0x00060000 length: 0x00010000 is_included: "no" path: "./hw/ip/pdm2pcm/data/pdm2pcm.hjson" - }, + } i2s: { offset: 0x00070000 length: 0x00010000 is_included: "no" path: "./hw/ip/i2s/data/i2s.hjson" - }, - }, + } + } flash_mem: { address: 0x40000000 length: 0x01000000 - }, + } ext_slaves: { address: 0xF0000000 length: 0x01000000 - }, + } interrupts: { number: 64 // Do not change this number! diff --git a/pad_cfg.hjson b/pad_cfg.hjson index 54a0389e7..65da702b8 100644 --- a/pad_cfg.hjson +++ b/pad_cfg.hjson @@ -30,83 +30,83 @@ clk: { num: 1 type: input - }, + } rst: { num: 1 active: low driven_manually: True type: input - }, + } boot_select: { num: 1 type: input - }, + } execute_from_flash: { num: 1 type: input - }, + } jtag_tck: { num: 1 type: input - }, + } jtag_tms: { num: 1 type: input - }, + } jtag_trst: { num: 1 active: low type: input - }, + } jtag_tdi: { num: 1 type: input - }, + } jtag_tdo: { num: 1 type: output - }, + } uart_rx: { num: 1 type: input - }, + } uart_tx: { num: 1 type: output - }, + } exit_valid: { num: 1 type: output - }, + } gpio: { num: 18 num_offset: 0 # first gpio is gpio0 type: inout - }, + } spi_flash_sck: { num: 1 type: inout - }, + } spi_flash_cs: { num: 2 # careful, the x-heep uses the CS from the spi pkg, change it type: inout - }, + } spi_flash_sd: { num: 4 type: inout - }, + } spi_sck: { num: 1 type: inout - }, + } spi_cs: { num: 2 type: inout - }, + } spi_sd: { num: 4 type: inout - }, + } pdm2pcm_pdm: { num: 1 @@ -114,166 +114,166 @@ mux: { pdm2pcm_pdm: { type: inout - }, + } gpio_18: { type: inout } } - }, + } pdm2pcm_clk: { num: 1 type: inout mux: { pdm2pcm_clk: { type: inout - }, + } gpio_19: { type: inout } } - }, + } i2s_sck: { num: 1 type: inout mux: { i2s_sck: { type: inout - }, + } gpio_20: { type: inout } } - }, + } i2s_ws: { num: 1 type: inout mux: { i2s_ws: { type: inout - }, + } gpio_21: { type: inout } } - }, + } i2s_sd: { num: 1 type: inout mux: { i2s_sd: { type: inout - }, + } gpio_22: { type: inout } } - }, + } spi2_cs_0: { num: 1 type: inout mux: { spi2_cs_0: { type: inout - }, + } gpio_23: { type: inout - }, + } } - }, + } spi2_cs_1: { num: 1 type: inout mux: { spi2_cs_1: { type: inout - }, + } gpio_24: { type: inout - }, - }, - }, + } + } + } spi2_sck: { num: 1 type: inout mux: { spi2_sck: { type: inout - }, + } gpio_25: { type: inout - }, + } } - }, + } spi2_sd_0: { num: 1 type: inout mux: { spi2_sd_0: { type: inout - }, + } gpio_26: { type: inout - }, + } } - }, + } spi2_sd_1: { num: 1 type: inout mux: { spi2_sd_1: { type: inout - }, + } gpio_27: { type: inout - }, + } } - }, + } spi2_sd_2: { num: 1 type: inout mux: { spi2_sd_2: { type: inout - }, + } gpio_28: { type: inout - }, + } } - }, + } spi2_sd_3: { num: 1 type: inout mux: { spi2_sd_3: { type: inout - }, + } gpio_29: { type: inout - }, + } } - }, + } i2c_scl: { num: 1 type: inout mux: { i2c_scl: { type: inout - }, + } gpio_31: { type: inout - }, + } } - }, + } i2c_sda: { num: 1 type: inout mux: { i2c_sda: { type: inout - }, + } gpio_30: { type: inout - }, + } } } } From 6ecb0342bfc5f80d33751122f695a1771616cebc Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 02:17:27 +0200 Subject: [PATCH 7/8] Remove trailing commas in `''',` --- hw/ip/dma/data/dma.hjson | 34 +++++++++++++++++----------------- hw/ip/i2s/data/i2s.hjson | 6 +++--- 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index 7419785b4..3221f59ab 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -54,7 +54,7 @@ ] } { name: "STATUS" - desc: '''Status bits are set to one if a given event occurred''', + desc: '''Status bits are set to one if a given event occurred''' swaccess: "ro" hwaccess: "hrw" hwext: "true" @@ -118,7 +118,7 @@ { name: "SLOT" desc: '''The DMA will wait for the signal connected to the selected trigger_slots to be high - on the read and write side respectivly''', + on the read and write side respectivly''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -132,7 +132,7 @@ ] } { name: "SRC_DATA_TYPE" - desc: '''Width/type of the source data to transfer''', + desc: '''Width/type of the source data to transfer''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -149,7 +149,7 @@ ] } { name: "DST_DATA_TYPE" - desc: '''Width/type of the destination data to transfer''', + desc: '''Width/type of the destination data to transfer''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -167,7 +167,7 @@ } { name: "SIGN_EXT" - desc: '''Is the data to be sign extended? (Checked only if the dst data type is wider than the src data type)''', + desc: '''Is the data to be sign extended? (Checked only if the dst data type is wider than the src data type)''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -182,7 +182,7 @@ ] } { name: "MODE" - desc: '''Set the operational mode of the DMA''', + desc: '''Set the operational mode of the DMA''' swaccess: "rw" hwaccess: "hro" fields: [ @@ -197,7 +197,7 @@ ] } { name: "DIM_CONFIG" - desc: '''Set the dimensionality of the DMA''', + desc: '''Set the dimensionality of the DMA''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -206,7 +206,7 @@ ] } { name: "DIM_INV" - desc: '''DMA dimensionality inversion selector''', + desc: '''DMA dimensionality inversion selector''' swaccess: "rw" hwaccess: "hro" resval: 0 @@ -215,7 +215,7 @@ ] } { name: "PAD_TOP" - desc: '''Set the top padding''', + desc: '''Set the top padding''' swaccess: "rw" hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding @@ -225,7 +225,7 @@ ] } { name: "PAD_BOTTOM" - desc: '''Set the bottom padding''', + desc: '''Set the bottom padding''' swaccess: "rw" hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding @@ -235,7 +235,7 @@ ] } { name: "PAD_RIGHT" - desc: '''Set the right padding''', + desc: '''Set the right padding''' swaccess: "rw" hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding @@ -245,7 +245,7 @@ ] } { name: "PAD_LEFT" - desc: '''Set the left padding''', + desc: '''Set the left padding''' swaccess: "rw" hwaccess: "hro" hwqe: "true" // enable `qe` latched signal of software write pulse: used to trigger the padding @@ -256,7 +256,7 @@ } { name: "WINDOW_SIZE" desc: '''Will trigger a every "WINDOW_SIZE" writes - Set to 0 to disable.''', + Set to 0 to disable.''' swaccess: "rw" hwaccess: "hro" fields: [ @@ -265,7 +265,7 @@ } { name: "WINDOW_COUNT" desc: '''Number of times the end of the window was reached since the beginning. - Reset at start''', + Reset at start''' swaccess: "ro" // hwext: "true", hwaccess: "hrw" @@ -276,7 +276,7 @@ } { name: "INTERRUPT_EN" desc: '''Interrupt Enable Register - (Only the interrupt with the lowest id will be triggered)''', + (Only the interrupt with the lowest id will be triggered)''' swaccess: "rw" hwaccess: "hro" fields: [ @@ -285,7 +285,7 @@ ] } { name: "TRANSACTION_IFR" - desc: '''Interrupt Flag Register for transactions''', + desc: '''Interrupt Flag Register for transactions''' swaccess: "ro" hwaccess: "hrw" hwext: "true" @@ -296,7 +296,7 @@ ] } { name: "WINDOW_IFR" - desc: '''Interrupt Flag Register for windows''', + desc: '''Interrupt Flag Register for windows''' swaccess: "ro" hwaccess: "hrw" hwext: "true" diff --git a/hw/ip/i2s/data/i2s.hjson b/hw/ip/i2s/data/i2s.hjson index bd06cfae0..dabba7fb3 100644 --- a/hw/ip/i2s/data/i2s.hjson +++ b/hw/ip/i2s/data/i2s.hjson @@ -10,17 +10,17 @@ regwidth: "32" param_list: [ { name: "MaxWordWidth" - desc: '''Defines the maximal word width''', + desc: '''Defines the maximal word width''' type: "int" default: "32" } { name: "ClkDividerWidth" - desc: '''Bits available for the clock divider''', + desc: '''Bits available for the clock divider''' type: "int" default: "16" } { name: "WatermarkWidth" - desc: '''Bits available for the watermark''', + desc: '''Bits available for the watermark''' type: "int" default: "16" } From 577e756ca793fe055da8764c2ed27335102b637f Mon Sep 17 00:00:00 2001 From: Javier Mora Date: Sat, 20 Jul 2024 02:32:40 +0200 Subject: [PATCH 8/8] Remove trailing commas in other situations - Followed by spaces - There's a commented-out line that has a trailing comma as well --- hw/ip/dma/data/dma.hjson | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/hw/ip/dma/data/dma.hjson b/hw/ip/dma/data/dma.hjson index 3221f59ab..11043984f 100644 --- a/hw/ip/dma/data/dma.hjson +++ b/hw/ip/dma/data/dma.hjson @@ -71,8 +71,8 @@ hwaccess: "hro" // Dimensioned to allow a maximum of a 15 element stride for a data_type_word case fields: [ - { bits: "5:0", - name: "INC", + { bits: "5:0" + name: "INC" desc: "Source pointer d1 increment" resval:4 } @@ -84,8 +84,8 @@ hwaccess: "hro" // Dimensioned to allow a maximum of 15 element stride for a data_type_word fields: [ - { bits: "22:0", - name: "INC", + { bits: "22:0" + name: "INC" desc: "Source pointer d2 increment" resval:4 } @@ -96,8 +96,8 @@ swaccess: "rw" hwaccess: "hro" fields: [ - { bits: "5:0", - name: "INC", + { bits: "5:0" + name: "INC" desc: "Destination pointer d1 increment" resval:4 } @@ -108,8 +108,8 @@ swaccess: "rw" hwaccess: "hro" fields: [ - { bits: "22:0", - name: "INC", + { bits: "22:0" + name: "INC" desc: "Destination pointer d2 increment" resval:4 } @@ -137,7 +137,7 @@ hwaccess: "hro" resval: 0 fields: [ - { bits: "1:0", name: "DATA_TYPE", + { bits: "1:0", name: "DATA_TYPE" desc: "Data type" enum: [ { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"} @@ -154,7 +154,7 @@ hwaccess: "hro" resval: 0 fields: [ - { bits: "1:0", name: "DATA_TYPE", + { bits: "1:0", name: "DATA_TYPE" desc: "Data type" enum: [ { value: "0", name: "DMA_32BIT_WORD", desc: "Transfers 32 bits"} @@ -172,7 +172,7 @@ hwaccess: "hro" resval: 0 fields: [ - { bits: "0", name: "SIGNED", + { bits: "0", name: "SIGNED" desc: "Extend the sign to the destination data" enum: [ { value: "0", name: "NO_EXTEND", desc: "Does not extend the sign"} @@ -267,7 +267,7 @@ desc: '''Number of times the end of the window was reached since the beginning. Reset at start''' swaccess: "ro" - // hwext: "true", + //hwext: "true" hwaccess: "hrw" resval: 0 fields: [