I have one scenario, on which i want to change connections of analysis port run time. so,i thought to use uvm phase jumping, i know this is not as per the guideline, but i have too.
So, my question is, if i jump to connect phase from run phase, for changing the port connection, does uvm has any feature which removes all existing connection? and allow me to do new one.
Please provide any alternate solution as well if any one has,
In reply to mitesh.patel:
Before I answer that question, you’re going to have to explain exactly why you think you need to change your connections at runtime. You could make all your connections up front and then have your subscribers just ignore the data if you want them to act like they’re disconnected.
I dont have a switch to disable consumer component(here, scoreboard) its always ON and I can not change it. Neither I can stop producer component(here, monitor) because its encrypted.
So to disable the scoreboard run time I can think of only one option as now. Which is to disconnect the connection of these two components. So the question is it possible to disconnect two components in run_phase? If yes then how can I do that?
You can add a control variable in the scoreboard which can enable/disable certain code and you can set the variable at run time by sending a transaction from monitor (or overridden monitor/new monitor). Care needs to be taken at what time to do this, not to loose any data
I can not change any existing code of monitor or scoreboard. i have only control of connection in my environment. so there is no point of adding the variable.
Scoreboard and monitor is encrypted.
Since you can’t change connections at runtime, you could connect your monitor to a “forwarder” which would be a subscriber with an analysis port whose write() method would conditionally call ap.write() based on a control variable. Then you would connect forwarder.ap to your scoreboard.
So, does it mean that we can not disconnect/change the connected connections in uvm?
The suggestion is good for the problem. but i want to know about disconnection of existing connection.
The strategy UVM has is seperating test from testbench. But the test can customize the testbench. Any modification will be executed prior to the run_phase. Then it is fix.
If you want to modify connections in your envrionemnt (testbench) you can define a new test doing this.
This approach is very structured and helpful for reuse.
“If you want to modify connections in your environment (testbench) you can define a new test doing this” What do you mean by creating new test? do you mean that for only this test i have add layer/component between monitor and scoreboard to control the write operations? for rest monitor-scoreboard connection should remains direct?
But still the question is the same. can i disconnect existing connection in uvm?
I do not see any need to have this functionality because the TLM modelling does not require such a behavior. In contrast to the RTL/pinlevel behavior no data are trasmitted from one component to another one automatically. You have always to make afunction call.