In my environment I'm dealing with network topology, first terminnoogy: The Verification Environment composed of DUT,Channels,Connections - each connection transmits packets via channels to the DUT.
The problem is how to control the packet attributes(i.e, pkt_color, pkt_size) in a flexiable way. I take those attributes as an simplified example.
I would like to constraine those attributes by hirearchical constraints, I hope the example below clarify the problem:
//Testcase test_1 (two hirearchies only)
//Topology: 1 channel, 3 connections{0,1,2} //All packets(exclude connection #0 are constrained according to: // pkt_size dist {100:=1,:500]/=5, 1000:2} // pkt_color dist {GREEN:=19, RED:=1} // Connection #0 packets are constrained according to: // pkt_size dist {500:=1, 1500:2} // pkt_color dist {GREEN:=1, RED:=0}
constraint connection::pkt_size_C { pkt_size dist {100:=1,:500]/=5, 1000:2} pkt_color dist {GREEN:=19, RED:=1} }
constraint connection::connection_global_c //why cant I use if(..)begin..end block (Questa 6.2ie) { if (con_id==0) pkt_size dist {500:=1, 1500:2} if (con_id==0) pkt_color dist {GREEN:=1, RED:=0} }
Output
<0> gen_pkts: con_id #0 Generates 3 Packets # <0> printme: Packet generated - pkt_size=500 # <0> printme: Packet generated - pkt_size=1500 # <0> printme: Packet generated - pkt_size=1500 # <0> gen_pkts: con_id #1 Generates 3 Packets # <0> printme: Packet generated - pkt_size=100 # <0> printme: Packet generated - pkt_size=350 # <0> printme: Packet generated - pkt_size=1000 # <0> gen_pkts: con_id #0 Generates 3 Packets # <0> printme: Packet generated - pkt_size=500 # <0> printme: Packet generated - pkt_size=700 # <0> printme: Packet generated - pkt_size=650 |