Skip to content

Commit

Permalink
Tests - Add test for large preset values, regenerate testfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanlippuner committed Nov 21, 2023
1 parent 86fb2fd commit d5d9461
Show file tree
Hide file tree
Showing 16 changed files with 118 additions and 2 deletions.
9 changes: 9 additions & 0 deletions testfiles/bug-const-range/const_range-consts.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#define CONST_RANGE_SIZE 20
#define ADDR_CONST_RANGE_LARGE_VAL_0 0x0UL
#define CONST_RANGE_LARGE_VAL_0_PRESET 0xf38243bbUL
#define ADDR_CONST_RANGE_LARGE_VAL_1 0x4UL
#define CONST_RANGE_LARGE_VAL_1_PRESET 0xfffffff7UL
#define ADDR_CONST_RANGE_SUPER_LARGE_VAL 0x8UL
#define CONST_RANGE_SUPER_LARGE_VAL_PRESET 0x818734fa9b1e0cf4ULL
#define ADDR_CONST_RANGE_SMALL_VAL 0x10UL
#define CONST_RANGE_SMALL_VAL_PRESET 0x1UL
11 changes: 11 additions & 0 deletions testfiles/bug-const-range/const_range-consts.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
package const_range_Consts;
localparam CONST_RANGE_SIZE = 20;
localparam ADDR_CONST_RANGE_LARGE_VAL_0 = 'h0;
localparam CONST_RANGE_LARGE_VAL_0_PRESET = 32'hf38243bb;
localparam ADDR_CONST_RANGE_LARGE_VAL_1 = 'h4;
localparam CONST_RANGE_LARGE_VAL_1_PRESET = 32'hfffffff7;
localparam ADDR_CONST_RANGE_SUPER_LARGE_VAL = 'h8;
localparam CONST_RANGE_SUPER_LARGE_VAL_PRESET = 64'h818734fa9b1e0cf4;
localparam ADDR_CONST_RANGE_SMALL_VAL = 'h10;
localparam CONST_RANGE_SMALL_VAL_PRESET = 32'h1;
endpackage
9 changes: 9 additions & 0 deletions testfiles/bug-const-range/const_range-consts.v
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
`define CONST_RANGE_SIZE 20
`define ADDR_CONST_RANGE_LARGE_VAL_0 'h0
`define CONST_RANGE_LARGE_VAL_0_PRESET 'hf38243bb
`define ADDR_CONST_RANGE_LARGE_VAL_1 'h4
`define CONST_RANGE_LARGE_VAL_1_PRESET 'hfffffff7
`define ADDR_CONST_RANGE_SUPER_LARGE_VAL 'h8
`define CONST_RANGE_SUPER_LARGE_VAL_PRESET 'h818734fa9b1e0cf4
`define ADDR_CONST_RANGE_SMALL_VAL 'h10
`define CONST_RANGE_SMALL_VAL_PRESET 'h1
14 changes: 14 additions & 0 deletions testfiles/bug-const-range/const_range-consts.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
library ieee;
use ieee.std_logic_1164.all;

package const_range_Consts is
constant CONST_RANGE_SIZE : Natural := 20;
constant ADDR_CONST_RANGE_LARGE_VAL_0 : Natural := 16#0#;
constant CONST_RANGE_LARGE_VAL_0_PRESET : std_logic_vector(32-1 downto 0) := x"f38243bb";
constant ADDR_CONST_RANGE_LARGE_VAL_1 : Natural := 16#4#;
constant CONST_RANGE_LARGE_VAL_1_PRESET : std_logic_vector(32-1 downto 0) := x"fffffff7";
constant ADDR_CONST_RANGE_SUPER_LARGE_VAL : Natural := 16#8#;
constant CONST_RANGE_SUPER_LARGE_VAL_PRESET : std_logic_vector(64-1 downto 0) := x"818734fa9b1e0cf4";
constant ADDR_CONST_RANGE_SMALL_VAL : Natural := 16#10#;
constant CONST_RANGE_SMALL_VAL_PRESET : std_logic_vector(32-1 downto 0) := x"00000001";
end package const_range_Consts;
14 changes: 14 additions & 0 deletions testfiles/bug-const-range/const_range-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
library ieee;
use ieee.std_logic_1164.all;

package const_range_consts_pkg is
constant c_CONST_RANGE_SIZE : Natural := 20;
constant c_CONST_RANGE_LARGE_VAL_0_ADDR : Natural := 16#0#;
constant c_CONST_RANGE_LARGE_VAL_0_PRESET : std_logic_vector(32-1 downto 0) := x"f38243bb";
constant c_CONST_RANGE_LARGE_VAL_1_ADDR : Natural := 16#4#;
constant c_CONST_RANGE_LARGE_VAL_1_PRESET : std_logic_vector(32-1 downto 0) := x"fffffff7";
constant c_CONST_RANGE_SUPER_LARGE_VAL_ADDR : Natural := 16#8#;
constant c_CONST_RANGE_SUPER_LARGE_VAL_PRESET : std_logic_vector(64-1 downto 0) := x"818734fa9b1e0cf4";
constant c_CONST_RANGE_SMALL_VAL_ADDR : Natural := 16#10#;
constant c_CONST_RANGE_SMALL_VAL_PRESET : std_logic_vector(32-1 downto 0) := x"00000001";
end package const_range_consts_pkg;
29 changes: 29 additions & 0 deletions testfiles/bug-const-range/const_range.cheby
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
memory-map:
bus: apb-32
name: const_range
x-hdl:
pipeline: rd-out
bus-error: True
wmask: True
description: 'Register with 32-bit wide preset values.'
children:
- reg:
name: large_val_0
width: 32
preset: 0xf38243bb
access: rw
- reg:
name: large_val_1
width: 32
preset: 4294967287
access: rw
- reg:
name: super_large_val
width: 64
preset: 0x818734fa9b1e0cf4
access: rw
- reg:
name: small_val
width: 32
preset: 0x1
access: rw
3 changes: 3 additions & 0 deletions testfiles/bug-consts/blkpfx-consts.vhdl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package blkpfx_Consts is
constant BLKPFX_SIZE : Natural := 4;
constant ADDR_BLKPFX_REG1 : Natural := 16#0#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/bug-consts/blkpfx-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package blkpfx_consts_pkg is
constant c_BLKPFX_SIZE : Natural := 4;
constant c_BLKPFX_REG1_ADDR : Natural := 16#0#;
Expand Down
5 changes: 4 additions & 1 deletion testfiles/demo_all-consts.vhdl
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
library ieee;
use ieee.std_logic_1164.all;

package demo_all_Consts is
constant DEMO_ALL_SIZE : Natural := 8448;
constant ADDR_DEMO_ALL_REG0 : Natural := 16#0#;
constant DEMO_ALL_REG0_FIELD00_OFFSET : Natural := 1;
constant DEMO_ALL_REG0_FIELD01_OFFSET : Natural := 4;
constant DEMO_ALL_REG0_FIELD02_OFFSET : Natural := 8;
constant ADDR_DEMO_ALL_REG1 : Natural := 16#4#;
constant DEMO_ALL_REG1_PRESET : Natural := 16#123#;
constant DEMO_ALL_REG1_PRESET : std_logic_vector(32-1 downto 0) := x"00000123";
constant ADDR_DEMO_ALL_REG2 : Natural := 16#8#;
constant DEMO_ALL_REG2_FIELD10_OFFSET : Natural := 0;
constant DEMO_ALL_REG2_FIELD11_OFFSET : Natural := 16;
Expand Down
5 changes: 4 additions & 1 deletion testfiles/demo_all-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
library ieee;
use ieee.std_logic_1164.all;

package demo_all_consts_pkg is
constant c_DEMO_ALL_SIZE : Natural := 8448;
constant c_DEMO_ALL_REG0_ADDR : Natural := 16#0#;
constant c_DEMO_ALL_REG0_FIELD00_OFFSET : Natural := 1;
constant c_DEMO_ALL_REG0_FIELD01_OFFSET : Natural := 4;
constant c_DEMO_ALL_REG0_FIELD02_OFFSET : Natural := 8;
constant c_DEMO_ALL_REG1_ADDR : Natural := 16#4#;
constant c_DEMO_ALL_REG1_PRESET : Natural := 16#123#;
constant c_DEMO_ALL_REG1_PRESET : std_logic_vector(32-1 downto 0) := x"00000123";
constant c_DEMO_ALL_REG2_ADDR : Natural := 16#8#;
constant c_DEMO_ALL_REG2_FIELD10_OFFSET : Natural := 0;
constant c_DEMO_ALL_REG2_FIELD11_OFFSET : Natural := 16;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/features/mapinfo1-consts.vhdl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package semver1_Consts is
constant SEMVER1_SIZE : Natural := 4;
constant SEMVER1_MEMMAP_VERSION : Natural := 16#10000#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/features/mapinfo1-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package semver1_consts_pkg is
constant c_SEMVER1_SIZE : Natural := 4;
constant c_SEMVER1_MEMMAP_VERSION : Natural := 16#10000#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/features/semver1-consts.vhdl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package semver1_Consts is
constant SEMVER1_SIZE : Natural := 4;
constant SEMVER1_VERSION : Natural := 16#10000#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/features/semver1-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package semver1_consts_pkg is
constant c_SEMVER1_SIZE : Natural := 4;
constant c_SEMVER1_VERSION : Natural := 16#10000#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/issue64/simple_reg1-consts.vhdl
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package sreg_map_Consts is
constant SREG_SIZE : Natural := 4;
constant ADDR_SREG_AREG : Natural := 16#0#;
Expand Down
3 changes: 3 additions & 0 deletions testfiles/issue64/simple_reg1-consts.vhdl-ohwr
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
library ieee;
use ieee.std_logic_1164.all;

package sreg_map_consts_pkg is
constant c_SREG_SIZE : Natural := 4;
constant c_SREG_AREG_ADDR : Natural := 16#0#;
Expand Down

0 comments on commit d5d9461

Please sign in to comment.