From 7955a5876bda3af6010f8c163f043d924f898120 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Wolfgang=20R=C3=B6nninger?= Date: Mon, 9 Mar 2020 15:42:34 +0100 Subject: [PATCH] tb_axi_cdc: Remove global `import axi_pkg::*` and properly define channels --- CHANGELOG.md | 3 +++ test/tb_axi_cdc.sv | 53 ++++++---------------------------------------- 2 files changed, 10 insertions(+), 46 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 553ea9037..34d1b8a20 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,9 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - `axi_cdc`: Remove unused global `import axi_pkg::*`. - `axi_intf`: Remove global `import axi_pkg::*` and explicitly use symbols from `axi_pkg`. - `axi_lite_cut_intf`: Add missing assigns to and from interface ports. +- `tb_axi_cdc`: + - Remove global `import axi_pkg::*`. + - Define channels with `AXI_TYPEDEF` macros instead of local `typedef`s. ### Removed - Remove unused `AXI_ARBITRATION` and `AXI_ROUTING_RULES` interfaces. diff --git a/test/tb_axi_cdc.sv b/test/tb_axi_cdc.sv index 8040717d2..44fb8f262 100644 --- a/test/tb_axi_cdc.sv +++ b/test/tb_axi_cdc.sv @@ -10,8 +10,8 @@ // Testbench for axi_cdc +`include "axi/typedef.svh" `include "axi/assign.svh" -import axi_pkg::*; module tb_axi_cdc #( // AXI Parameters @@ -109,51 +109,12 @@ module tb_axi_cdc #( typedef logic [AXI_IW-1:0] id_t; typedef logic [AXI_DW/8-1:0] strb_t; typedef logic [AXI_UW-1:0] user_t; - typedef struct packed { - id_t id; - addr_t addr; - len_t len; - size_t size; - burst_t burst; - logic lock; - cache_t cache; - prot_t prot; - qos_t qos; - region_t region; - atop_t atop; - user_t user; - } aw_chan_t; - typedef struct packed { - data_t data; - strb_t strb; - user_t user; - logic last; - } w_chan_t; - typedef struct packed { - id_t id; - resp_t resp; - user_t user; - } b_chan_t; - typedef struct packed { - id_t id; - addr_t addr; - len_t len; - size_t size; - burst_t burst; - logic lock; - cache_t cache; - prot_t prot; - qos_t qos; - region_t region; - user_t user; - } ar_chan_t; - typedef struct packed { - id_t id; - data_t data; - resp_t resp; - user_t user; - logic last; - } r_chan_t; + + `AXI_TYPEDEF_AW_CHAN_T(aw_chan_t, addr_t, id_t, user_t) + `AXI_TYPEDEF_W_CHAN_T(w_chan_t, data_t, strb_t, user_t) + `AXI_TYPEDEF_B_CHAN_T(b_chan_t, id_t, user_t) + `AXI_TYPEDEF_AR_CHAN_T(ar_chan_t, addr_t, id_t, user_t) + `AXI_TYPEDEF_R_CHAN_T(r_chan_t, data_t, id_t, user_t) axi_cdc_intf #( .AXI_ADDR_WIDTH (AXI_AW),