Showing posts with label Sample Codes. Show all posts
Showing posts with label Sample Codes. Show all posts

Monday, 24 December 2007

Raised Objection Report

Any raised objection will prohibit your simulation to stop. And In large environments, it may be painfull to find the one objection still raised using the SN commands 'show objections' or 'trace objections'.

You may just load follwoing e-code in your test and you'll be able to get a short report of all raised objections by typing 'sys.report_raised_objections(TEST_DONE)'


<'
extend sys
{
report_raised_objections(kind : objection_kind) is
{
// usage: sys.report_raised_objections(TEST_DONE)
var obj_units : list of any_unit = get_all_units(any_unit).all(.get_objection_counter(kind) > 0);
outf("-----------------------------------------------\n");
outf("Objection Report:\n");
outf("Counter Total Env e path\n");
outf("------- ----- ---- ------\n");
for each (u) in obj_units
{
outf("%-7d %-5s %-7s \n", u.get_objection_counter(kind), u is an any_env ? u.short_name() : "", u.e_path());
};
};
// just to print the command in the sn window
run() is also
{
outf("-----------------------------------------------\n");
outf("REPORT_RAISED_OBJECTIONS loaded\n");
outf("usage: sys.report_raised_objections(TEST_DONE)\n");
outf("------------------------------------------------\n");
};
};
'>

Thursday, 13 December 2007

eToolkit from Verilab

Here is a very useful toolkit from Verilab to understand somebody else's e environment. It is especially useful when you want to have an overview and detailed view of the e code.

http://www.verilab.com/resources/e-toolkit/

Using this toolkit, you can find like inheritance hierarchy of classes and also find declaration and extension of classes, enumtypes, methods and coverage groups.

Tuesday, 11 December 2007

Access Multi Language Signals using Ports

Ever came across the issue where one unit's signal map uses different signals from multi language design (VHDL and Verilog)? Take following example.

As shown in the diagram, top_wrapper is in vhdl and DUT is in verilog. Corresponding to this design, in e domain, two units are defined, one is top_wrapper_u and another dut_u.





Now, somewhere in dut_u unit, if you want to use clk from dut (verilog) and reset_n from top_wrapper (vhdl ), you can not do it using computed names (using strings). To achieve this, you have to use e external ports. Once ports are defined, using .agent() attribute of the units and ports, you can define, which unit/port is belonged to which design unit (vhdl/verilog).

As shown in the following code, refer the last line. reset_n.agent() is constrained to vhdl so that reset_n will be taken from vhdl module and rest of the ports in the dut_u will be taken from verilog module as dut_u.agent() is constrained to verilog.


<' unit dut_u
{
clk : in simple_port of bit is instance;
reset_n : in simple_port of bit is instance;

keep bind (clk, external);
keep bind (reset_n, external);


keep clk.hdl_path = "clk";
keep reset_n.hdl_path = "reset_n";


};



unit top_wrapper_u
{
dut : dut_u is instance;
};



extend sys
{
top : top_wrapper_u is instance;

keep top.hdl_path() == "~/top_wrapper";
keep top.dut.hdl_path() == "~/top_wrapper/dut";


keep top.agent() == "vhdl";
keep top.dut.agent() == "verilog";
keep top.dut.reset_n.agent() == "vhdl";


};
'>