How to pass down sequence item bus width macros and values using config db down to other components in a generic agent?

Hi All.
I am trying to create testbench for a generic sideband agent that does the job of driving interrupts (GPIO Signals)onto the DUT. The bus width is [256:0] and I have created 2 sub-buses for synchronous interrupt registers and 1 for asynchronous register, like:
**bit [SYNCA_MAX:SYNCA_MIN] syncinterrupt1;
bit [SYNCB_MAX:SYNCB_MAX] syncinterrupt2;
bit [ASYNC_MAX:ASYNC_MIN] asyncinterrupt;
**
From the environment I intend to create a configuration class for the agent and define the macros for the above signal bus widths, as well as values for those signals, and then pass down that value to the driver, sequencer, etc.
I am having difficulty visualizing how to exactly do that. So, the env has to be the only component capable of taking user input(i.e. bus widths and signal values) and every other component has to be generic. The user input gets passed down to the sequence item, the driver drives that sequence onto the DUT through the interface.

Following are portions of the code:
Interface:
interface sideband_if(input logic clk,reset);
define MAX_BUSWIDTH 256 define SYNCA_MAX 15 //[15:0]
define SYNCA_MIN 0 define SYNCB_MAX 45 //[45:16]
define SYNCB_MIN 16 define ASYNC_MAX 200 //[200:100]
`define ASYNC_MIN 100
//---------------------------------------
//declaring the signals
//---------------------------------------
logic [SYNCA_MAX:SYNCA_MIN] syncinterrupt1;
logic [SYNCB_MAX:SYNCB_MAX] syncinterrupt2;
logic [ASYNC_MAX:ASYNC_MIN] asyncinterrupt;
logic wr_en;
//---------------------------------------
//driver clocking block
//---------------------------------------
clocking driver_cb @(posedge clk);
default input #1 output #1;
inout syncinterrupt1;
inout syncinterrupt2;
output wr_en;
endclocking
//---------------------------------------
//driver modport
//---------------------------------------
modport DRIVER (clocking driver_cb,input clk,reset, logic asyncinterrupt);
endinterface

So the basic questions are:
How to pass down the sequence item bus widths and signal values inputted by the user into the environment, down to the sequence item and driver and interface, using config db? I will have a configuration class in the env where I take those values, but should I take them in format of an array? What then?I’m a student and a beginner and am having trouble visualizing.Thanks!

In reply to raivaichu1109:

A few remarks only.
To pass parameters to the environment and objects you can use packages or you can do this using the config_db or you are using macros from a specific macro file. It depends on your preferences.

What I see in your code. You have a few critical things there:
(1) your reset signal is not in the clocking block.
(2) Your DRIVER modport has an entry ‘logic asyncinterrupt’. This is not legal. The modport specifies only the data direction.
(3) When using a clocking block you do not need the clk and the reset in your modport. This is always covered by the clocking block.

In reply to chr_sue:

Thank you!

Okay, so I will add the reset signal in the clocking block.

Since “asyncinterrupt” is an asynchronous signal I didn’t add it in Clocking block so I have to add it seperately in the modport list, and since it can be both input and output, what should I write in the modport?

In reply to raivaichu1109:

If you are using clocking blocks all signals should go through this. If you have a signal which is bidirectional it is an inout. clocking blocks can handle this.