hi ,
I am new to uvm and need help in setting up muliple slaves environment . the environment is working for one agent instance.Need now 8 slave environment . this is a SPI slave where based on the slave select the corresponding slave has to respond back (MISO) line.
In my top module i am having the 8 interface instance connections like this…
spi_if spi0_if();…7more like this
connecting MOSI,MISO,clk to the dut with differnt slave select lines to interfaces.
in my env class i have :
class env extends uvm_env
…
spi_agent agents;
in build phase:
for(int i = 0; i < num_agents; i++) begin
$sformat(inst_name, “agents[%0d]”, i);
set_config_int(inst_name, “is_active”, UVM_ACTIVE);
agents[i] = spi_agent::type_id::create(inst_name, this);
agents[i].agent_id = i;
now i need help on these .
- i want to drive virtual interface in the driver based on slave select.something like all agents are active but based on slave select the slave agent would respond.for this i tried the suggested help in some forum threads that inside the config object for each of my agents have a virtual interface handle, assign that via the uvm_config_db and then pass the config object to agent… and getting this vifs in my driver class …something like this :
in driver class :
if (!uvm_config_db #(spi_config)::get(this, “agent[0]”, “spi_config”, cfg)) // get config object
uvm_fatal("Config Fatal", "Can't get the spi_config") if (!uvm_config_db #(spi_config)::get(this, "agent[1]", "spi_config", cfg)) // get config object
uvm_fatal(“Config Fatal”, “Can’t get the spi_config”)
in env class
if(!uvm_config_db #(virtual spi_if)::get(this,“”,“spi0_if”,spi_ve_config.spi0_if))
uvm_error("RESOURCE_ERROR","interface not found") uvm_config_db #(spi_config)::set(this, "agents[0]*", "spi_config", spi_ve_config); if(!uvm_config_db #(virtual spi_if)::get(this,"","spi1_if",spi_ve_config.spi1_if))
uvm_error(“RESOURCE_ERROR”,“interface not found”)
uvm_config_db #(spi_config)::set(this, “agents[1]*”, “spi_config”, spi_ve_config);
but now i would have a common config object which has handles to 8 virtual interfcaces
when i drive a particular agents sequence and in my sequence selecting a slave select i am able to drive any agents vif …want to know whether this is right?? or else how to implement correctly
2)when i create 8 agent instances i have 8 drivers,8 monitors,8 sequencers.Inside monitor class i have analysis port which broadcasts to system scoreboard…so now i have 8 analysis ports connect to one analysis imp of scoreboard.i am planning to pass my sequence item information regarding slave select and connect only that agents slaves monitor analysis port…is this right please help…if possible please point to a complete working example of multiple slaves where i can understand how to drive only particular vifs.and connect analysis for the scenario i mentioned above…if not example please give guidelines to proceed…