Previous Section Next Section

13.7 Environment Object

This section discusses the requirements and e code for the environment object. The environment object is introduced to make the verification system of the router more transportable to other environments. The environment object is then instantiated under sys. Otherwise, the components under the environment could be instantiated directly under the sys struct.

13.7.1 Requirements for Environment Object

The primary requirement for the environment object (sbt_env unit) is to build the hierarchy as shown in Figure 13-1 below. Note that sbt_env unit is instantiated under the predefined sys struct.

Figure 13-1. Environment Object Hierarchy

graphics/13fig01.gif

13.7.2 e Code for the Environment Object

Example Figure 13-8 displays e code for the environment object.

Example 13-8 e Code for the Environment Object
File contains e code for the environment object.
<'
-- Import all files
import sbt_packet;
import sbt_driver;
import sbt_scoreboard;
import sbt_receiver;
import sbt_checker;
import sbt_packet_cover;
import sbt_dut_cover;

struct sbt_env {
    -- Instantiate one sbt_driver
    sbt_driver : sbt_driver is instance;
    keep sbt_driver.hdl_path() == "~/top";

    -- Create a list of sbt_receivers (3 are needed)
    -- One per each channel. Each receiver in turn
    -- also instantiates the sbt_scoreboard
    sbt_receivers[3] : list of sbt_receiver is instance;
    -- Assign the numbers 0, 1 and 2 to the number field of each
    -- receiver
    keep for each in sbt_receivers {
        .hdl_path() == "~/top"; -- define hdl_path() of each
                                -- receiver
        .port_no == index; -- set port_no of each receiver
                           -- 0, 1, 2.
    };

    -- Create one instance of sbt_dut_cover
    sbt_dut_cover : sbt_dut_cover is instance;
    keep sbt_dut_cover.hdl_path() == "~/top"; -- Set hdl_path
};

-- Create an instance of sbt_env object in
-- the top-level sys struct.
extend sys {
    sbt_env : sbt_env is instance;
};


'>
Previous Section Next Section