mirror of
https://github.com/Silicon1602/srdl2sv.git
synced 2024-11-13 02:53:37 +00:00
Fix two issues to get AMBA widget compile clean under Verilator
The former issue was a Lint warning. HADDR % HSIZE is a modulo operation of a 32-bit and 3-bit variable. It is cleaner to only use the LSB of HADDR. Furthermore, Verilator does not support unpacked arrays in packages.
This commit is contained in:
parent
240fba8e12
commit
a27b57009b
@ -100,7 +100,7 @@ module srdl2sv_amba3ahblite
|
||||
logic [31:0] addr_q;
|
||||
OP_t operation_q;
|
||||
|
||||
wire addr_err = (HADDR % HSIZE) != 0;
|
||||
wire addr_err = (HADDR[2:0] % HSIZE) != 3'b0;
|
||||
|
||||
always_ff @ (posedge HCLK)
|
||||
begin
|
||||
|
@ -1,6 +1,6 @@
|
||||
package srdl2sv_if_pkg;
|
||||
|
||||
typedef struct {
|
||||
typedef struct packed { // .Verilator does not support unpacked structs in packages
|
||||
logic [31:0] addr;
|
||||
logic [31:0] data;
|
||||
logic w_vld;
|
||||
@ -8,7 +8,7 @@ typedef struct {
|
||||
logic [ 3:0] byte_en;
|
||||
} b2r_t;
|
||||
|
||||
typedef struct {
|
||||
typedef struct packed { // .Verilator does not support unpacked structs in packages
|
||||
logic [31:0] data;
|
||||
logic rdy;
|
||||
logic err;
|
||||
|
Loading…
Reference in New Issue
Block a user