Detailed Tool Operation For Generating Complete UVM Testbench - hellovimo/uvm_testbench_gen GitHub Wiki

Table of Contents

1. Key Highlights

  • Supports Single and Multi Environment VIP Configuration
  • GUI based [obviously] and Spreadsheet based approach to build the templates
  • Environment configuration dump into spreadsheet for easy load and edit process
  • Novel 'Create & Stitch' functionality to edit, enhance and integrate VIP's [preferably created from this tool]
  • Flexible Monitor-Scoreboard connectivity matrix
  • Multi Instance Agent, Multi Env Monitor/Scoreboards, Multi Instance Environment Support to cater socket based scenarios

2. Lets Deep Dive and See The Detailed Operation Of UVM Template Generator As Given Below

The UVM template generator provides the user to generate,

  • Single UVM Components.
  • Single and Multi Env VIP as shown in Figure 1 below.

3. Building Single or Multi Env VIP

The moment user clicks the 'Single & Multi Env VIP' button, the following tool layout opens up as shown in Figure 2 below,

The user can click either the 'GUI Approach' or the 'Load Spreadsheet Approach' to create the required environment skeleton files.

4. GUI Based Approach

4.1. Initial Layout

When the user clicks the 'GUI Approach' button, the tool pops open the layout snapshot as shown in Figure 3 below,

4.2. Loading the Environment Details

The tool provides the following entries to input details about the environment which the user is trying to create. They are:

4.2.1 Entering the Environment name

  • Enter Env Name : This entry is provide to input the name for the Single or Top level environment in multi environment configuration. User should always provide the details in the given below format.
    • User have the option to create N-Instance of the top level environment.
    • Format: (Parent Environment Name)/(Environment Name)
    • As this will be a single environment or the top level environment, the 'Parent Environment' should be named as 'top'.
    • Eg: top,aloha - Here the Parent Name is 'top' and the Environment name is 'aloha' or top,aloha:3 - Here the Environment name is 'aloha', followed by N-Instance of the environment.
    • Below Figure 4 is the snapshot of the tool with the Env Name entered.

4.2.2. Entering the Sub Env Name

  • How Many Sub Env You Want To Create: This entry is provided for the user to enter the Sub-Environment details if there is any under the Environment. The user can enter N-Number of Sub-Environments and also N-Instance of the same sub environment.
    • Format: (Number of Sub-Env),(Name Of The Sub-Env) or (Number of Sub-Env),(Name Of The Sub-Env):(Number of Instance Of the Environment)
    • Eg: 1,maui or 2,maui,kawai or 1,maui:5
    • Below is the snapshot of the tool with the Sub-Env details Entered [Figure 5: With Single Instance Sub-Env, Figure 6: With Multi Instance Sub-Env].

4.2.3. Entering the Agent Details

  • How Many Agents You Want To Create: This entry is provided for the user to enter the Agent related details. User can enter N-Number of agents based on the requirement.
  • Format: (Number of Agents),(Name of the Agents)
  • Eg: 1,master or 2,master,slave
  • NOTE/CAREFUL: This entry window is a special "FOCUSED OUT" entry widget.
    • Once you enter into the agent entry window, make sure you provide the required details before you hop out.
    • The moment user clicks the entry window, enters the required details and move "out of focus" of the entry space, the tool internally takes in the details entered by the user. [Move 'out of focus' meaning: When the user types/enters the 'tab' button or when the user 'clicks' the cursor outside of the tool]
    • Based on the details entered the tool "pops-up" a new layout to provide the required details for the Agent. Below Figure 7 is the snapshot of the pop-up window.
  • The user can provide N-Number of driver based on the requirement

  • Format: (Number of Driver),(Name of the Driver Components)

  • Eg: 1,red or 2,red,ruby

  • Similarly user can provide the details for the required number of Monitors inside the agent

  • Format: (Number of Monitor),(Name of the Monitor Components)

  • Eg: 1,amon or 2,amon,amon1

  • In the above Figure 7 you can see the option for 'Choose The Type Of Interface' is in default state as the user hasn't provided any details about the required driver.

  • NOTE/CAREFUL: The Entry window for 'Enter Required Number of Driver~Sequencer' is also a "FOCUSED OUT" widget. The moment user enters the details about the 'driver', the tool automatically understand and takes in the required interface details for the driver provided as shown in the below Figure 8.

  • The tool knows based on the number of driver details entered, the tool needs to take the required interface details.
  • Once you choose the interface details for the first driver, the user needs to click the 'NEXT INTF CONFIG' button to proceed further to provide the details for the next driver Interface as shown below in Figure 9.
  • The tool provides the user with option to go back and forth to enter/change the type of interface choose for the required driver by clicking 'PREVIOUS INTF CONFIG'.
  • Once the user is sure about entering the required interface details, the user needs to click the 'SAVE INTF CONFIG' button to save the interface details for that particular driver['s] in the database.
  • After the user clicks the 'SAVE INTF CONFIG' button, based on the number of agents entered, the tool knows whether to close the Agent Window or provide the option 'NEXT AGENT CONFIGURATION' as shown below in Figure 10.
  • Once the user clicks the 'NEXT AGENT CONFIGURATION' button, the below snapshot opens providing user to enter the details about next agent. Also the tool provides option for user to go back to the previous agent details by clicking 'PREVIOUS AGENT CONFIGURATION' if he wanted to modify any details.
  • Once the user finishes entering the details for all the agents, the user needs to click the 'DONE AGENT CONFIGURATION' as show in Figure 11 below to store the agent details in the database. By clicking so, the tool saves the details and closes the Agent Window.

4.2.4. Entering the Environment Monitor Details

  • How Many Monitors You Want To Create: This entry is provided for user to record details about environment level monitors used. User can provide N number of monitor's based on the requirement.
  • Format: (Number of Monitors),(Name of the Monitor Components)
  • Eg: 1,amon or 2,amon1,amon2 as show in the Figure 12 below.
  • Also the user is provided with option to create N-Instance of the same monitor based on the requirement.
  • Format: (Number of Monitors),(Name of the Monitor Components):(N-Instance of the Same Monitor).
  • Eg: 1,amon:2 as shown in the Figure 13 below.

4.2.5. Entering the Environment Scoreboard Details

  • How Many Scoreboards You Want To Create: This entry is provided for user to record details about scoreboards. User can provide N number of scoreboards based on the requirement.
  • Format: (Number of Scoreboards),(Name of the Scoreboard Components)
  • Eg: 1,ascb or 2,ascb1,ascb2 as shown in the below Figure 14.
  • Also the user is provided with option to create N-Instance of the same scoreboard based on the requirement.
  • Format: (Number of Scoreboards),(Name of the Scoreboard Components):(N-Instance of the Same Scoreboard).
  • Eg: 1,ascb:3 as shown in the below Figure 15.

4.2.6. Entering Environment Interface Details

  • How Many Env Interface To Create: This entry is provided for the user to create the required environment level interface files. User can create N-Number of interface files which can be used in the environment level monitor/scoreboard components.
  • Format: (Number Of Environment Interface),(Name of the Interface Files)
  • Eg: 1,aintf or 2,aintf1,aintf2
  • NOTE/CAREFUL: The Entry window for "How Many Env Interface To Create" is a 'FOCUSED OUT' entry window.
    • The moment user enters the required details and come out of the layout, the tool opens up a new layout taking the environment interface details as shown below in Figure 16.
  • Once entering the required interface details, the user needs to click the 'SAVE INTF CONFIG' button to store the interface info into the database.

4.2.7. Entering the Environment Directory Path Details

  • Specify The Environment Directory Path: Here user need to provide the details about where the environment files needs to be created or it points to place where the environment files exists if the environment component already exists.
  • If the user wants to create / [files already exists] in the current directory, the tool by default have the option typed as 'pwd'. Else user can right click the entry window, so that a new pop-up window opens, where in you can choose the required directory location as shown below Figure 17.

4.2.8. Configuring the Monitor-Scoreboard Connectivity in the Matrix

  • Once the user has entered the required environment level component details, the user also need to make sure the connectivity between monitor & scoreboard needs to be done if any exists.
  • The user is provided with button called 'ENV SETUP' and when the user clicks the button, the tool automatically pops-up a new 'Environment Setup Window' as shown in the below Figure 18.
  • In this window, the tool collects the details about all the monitors and the scoreboards used inside the respective environment and lays out as a cross matrix. So that the user can connect the required monitor to the corresponding scoreboard with N-number of ports.
  • Below is the snapshot [Figure 19] of the window that pops-up when the button is clicked.
  • Once after entering all the required connectivity details as shown in the above snapshot [right] and when the user clicks the 'STORE PORT' button, the tool takes the user back to the default window state. Finally, the user need click the 'SAVE ENV SETUP' to store the details into the tool and the particular connectivity matrix table closes.
  • This mainly helps in configuring the connectivity between monitor & scoreboard within the particular environment. How about connectivity components across the environment ??
  • Once after configuring the connectivity details for each environment, the tool finally pops-up/provides option to user called 'FINAL ENV SETUP', where in the user is provided with the matrix table to configure the connection between components across multiple environment as in the snapshot shown below in Figure 20. Here you can see the matrix table is loaded with details about components across multiple environment and based on the requirement the respective connection can be done.

4.2.9. Final Steps To Generate The Code

  • Once the user has finished entering all the required details of the environment [or multi environment] and the connectivity information, the tool is provided with the button called 'DONE ENV CFG' as shown below Figure 21.
  • Once the user clicks the 'DONE ENV CFG' button, the tool takes the user to the final layout with the buttons such as 'RETURN TO MAIN MENU, GENERATE CODE or EXIT CODE GENERATOR' as show in the below Figure 22.
  • Based on what needs to be done, user can click the 'GENERATE CODE' to go ahead and build/create all the required templates for the environment or if user wanted to re-started entering/loading the details, user can click the 'RETURN TO MAIN MENU' or if the user wanted to close the tool, then the user can click the 'EXIT CODE GENERATOR' button.
  • Once the user clicks the 'GENERATE CODE' button, the tool starts building all the required directory structures, component files, etc., as specified in the section 7. Directory Structure.
  • One key important thing that gets generated when the tool dumps out is the 'environment configuration dump' inside the 'docs' directory. This configuration spreadsheet contains the entire details about what environment the user created, so that the same spread sheet can be re-used for enhancing the environment structure.

5. Load Spreadsheet Approach

5.1 Initial Layout

  • When the user clicks the 'LOAD SPREADSHEET APPROACH' button, the tools pops-up with the layout as shown below in Figure 23.

5.2. How To Load The Spread-Sheet

  • User need to right click on the respective entry window, which allows the tool to pop open the directory traversing window as shown below in Figure 24.
  • The user can either input the path for the spreadsheet which contains the environment details, or pass the sheet name along with the spread-sheet to load the specific file.
  • Format: (Spreadsheet Root Path) or (Spreadsheet Root Path),(Sheet Name)
  • Once after entering the required spreadsheet, the user needs to click the button 'PARSE SPREADSHEET'. Clicking so the tool internally ready the details of the environment provided in the spread-sheet and opens up the GUI tool with the details loaded up as shown below in Figure 25.
  • So that the user can add/edit new components onto the environment using the new techniques which will be detailed below.

5.3. Spreadsheet Layout

  • Below Figure 26 is the snapshot of the spread-sheet which will be used to store the environment details while creating the templates using the GUI approach or the user can manually enter the details in the spreadsheet and load up in the tool to iterate over the same.
  • The above snapshot shows the following entries in which the user can enter required environment details.
  • Environment No: Just default number followed in the spreadsheet starting with 0 as the starting number.
  • Environment entry is the place where the user provides the environment name.
  • ParentEnv is the entry where the user needs to enter the name of the parent environment. For the single/top level environment the name of the ParentEnv is 'top'.
  • SubEnvironment takes the required details about sub-environment.
  • Monitor entry is the place where the user provide the environment level monitor details.
  • Scoreboard is the place where in user can enter the required checker details.
  • Agent entry is the place where in you the user can enter the required agent details.
  • Next to which is the AgentConfig entry, which takes in series of details about driver, monitor, interface etc. as pointed out in the snapshot.
  • Next is the MonScbCon entry place where the user need to enter the details about the monitor-scoreboard connectivity information.
    • NOTE: If the connection is for the monitor-scoreboard components existing within the environment then user just need to provide the details in the format as given below.

    • Format : This is for connecting monitor inside an agent to the scoreboard (Environment Name),(Agent Name),(Monitor Name)-(Environment Name),(Scoreboard Name)-(Connectivity Name, Type of connectivity)

    • This is for connecting monitor inside an environment to the scoreboard (Environment Name),(Monitor Name)-(Environment Name),(Scoreboard Name)-(Connectivity Name, Type of connectivity)

    • Type of Connectivity Detail: 1 - FIFO based approach, 2 - Write Function based approach

    • Eg: aloha,master,mmon-aloha,ascb-aoo,2

    • NOTE: If the connection is for the monitor-scoreboard existing across environment then user need to provide the details of the parent environment as well. Format as shown below.

    • Format: (Parent Environment Name),(Environment Name),(Agent Name),(Monitor Name)-(Parent Environment Name),(Environment Name),(Scoreboard Name)-(Connectivity Name, Type of connectivity)

    • Eg: kawai,nrkaw,nrkmon-top,aloha,ascb-tee,2

  • EnvIntfDetails is the entry where in you enter the details about the interface which you wanted to add at the environment level.
  • Directory entry is where the user need to provide the detail about where the environment needs to be created or where the environment exists if already the environment is created.
  • EnvCfgFilePath is the entry where user need to provide the connecting environment configuration file is user wanted to add an environment into other existing environments. Or this is the entry place where the tool dumps the details about the sub-environments which is being created under this top level environment.

5.4. Reference Examples

6. Novel Create and Stitch Feature

  • The tool is enabled with this Novel 'Create & Stitch Feature'.
  • This process provides the user to append the already existing environments [created from this tool] with newly created components using 'Create & Stitch Process'.
  • Or, the user can use the 'Stitch Process' to integrated the already available components to the existing environments.
  • These above steps are done without deleting any of the already existing codes, but rather intuitively goes and edits the required files/codes based on the user need.
  • The tool offers the above features to do the editing at various granular level as explained below.

6.1. Creating New Connections In Already Existing Environment

  • All the user need to do in order to add connectivity between monitor and scoreboard in already existing environments is:
    • Open the tool, choose the 'Single & Multi Env VIP'.
    • Then choose the 'Load Spreadsheet Approach' option.
    • Choose the required spreadsheet [& sheet] for the respective environment in which you wanted to add connections and press 'PARSE SPREADSHEET'.
    • Once parsed, go to the respective environment or the last environment and press the 'ENV SETUP' button as shown below in Figure 27.
    • Choose the respective drop down option to add the required ports. Follow the syntax as given below to enter the name of the ports for going to newly created one in existing environment.
    • Format: (Port Name)__c
    • NOTE: That is 'double underscore' after the port name followed by c. So, that the tool is being indicated saying, this is a new port which is going to be created and connected between respective monitor and scoreboard as shown in the below Figure 28.
    • Once the required port detail is entered, press 'STORE PORT' → 'SAVE ENV SETUP'→ 'DONE ENV CFG'→ 'GENERATE CODE' to create the new port connectivity and get it added to the environment.

6.2. Adding new Environment Level Monitors and Scoreboard in Already Existing Environment

  • All the user need to do in order to create and stitch new Environment level monitors and scoreboard in already existing environment as follows:
    • Open the tool, choose the 'Single & Multi Env VIP'.

    • Then choose the 'Load Spreadsheet Approach' option.

    • Choose the required spreadsheet [& sheet] for the respective environment in which you wanted to add new Env monitors and Scoreboard and press 'PARSE SPREADSHEET'.

    • Once parsed, go to the respective environment and place your cursor in the respective 'How Many Monitors You Want To Create' entry window and follow the below syntax to newly create the monitor [& Scoreboard] to the existing environment as shown below in Figure 29.

    • Format/Syntax If user want to Newly Create and Add [Monitor & Scoreboard]: (Component Name)__c

    • NOTE: That is 'double underscore' after the component name followed by c. So that the tool is being indicated saying, user is trying to create new components and add to the respective environment.

    • Format/Syntax If user want to Just Stitch [i.e. Add] [Monitor & Scoreboard]: (Component Name)__s

    • NOTE: That is 'double underscore' after the component name followed by s. So that the tool is being indicated saying, user is trying to just add already existing components and stitch to the respective environment.

6.3. Adding Driver/Monitor inside Already Existing Agents and Adding New Agents Into Existing Environments

  • All the user need to do in order to create and stitch new drivers/monitors in an existing agent or add a new agent into an existing environment as follows:
    • Open the tool, choose the 'Single & Multi Env VIP'.

    • Then choose the 'Load Spreadsheet Approach' option.

    • Choose the required spreadsheet [& sheet] for the respective environment in which you wanted to add new drivers/monitors into an Agent or Agents into an environment and press 'PARSE SPREADSHEET'.

    • Once parsed, go to the respective environment and place your cursor in the respective 'How Many Agents You Want To Create' entry window.

    • If the user decide to add a new Agent into the existing environment, follow the syntax below to add the new Agent. Change the respective number of Agent Number and add the required Agent Name and Click the curse outside of the entry window. NOTE: As explained above, this is a 'FOCUSED OUT' widget and once the user enters the details and steps out, the tool acts based on the details entered.

    • Format/Syntax If user want to Newly Create and Add Agent: (Component Name)__c

    • NOTE: That is 'double underscore' after the component name followed by c. So that the tool is being indicated saying, user is trying to create new components and add to the respective environment.

    • Format/Syntax If user want to Just Stitch [i.e. Add] Agent: (Component Name)__s

    • NOTE: That is 'double underscore' after the component name followed by s. So that the tool is being indicated saying, user is trying to just add already existing components and stitch to the respective environment.

    • The moment user clicks the cursor outside the 'Agent Entry Window', the tool pops-open a new window taking the required Agent related details as shown in the snapshot below in Figure 30. And if the user wanted to add new drivers/monitors into the already existing agent, user need to following the same syntax/format described above.

  • When the user adds the new agent, the tool automatically know that it needs to fetch the details for the respective Agent. So, once after traversing across the existing agents, the tool provides the button saying 'NEXT AGENT CONFIGURATION' to go to the next component as shown below [Figure 31].
  • Clicking that the tool will take the user to the next newly added agent to enter the required details as shown below [Figure 32].

6.4. Adding an Environment as a whole using Create and Stitch or Stitch Process

  • All the user need to do in order to create and stitch new Environments in an existing top level environment as follows:
    • Open the tool, choose the 'Single & Multi Env VIP'.

    • Then choose the 'Load Spreadsheet Approach' option.

    • Choose the required spreadsheet [& sheet] for the respective environment in which you wanted to add a new Sub-Environment and press 'PARSE SPREADSHEET'.

    • Once parsed, go to the respective environment and place your cursor in the respective 'How Many Sub Env You Want To Create' entry window.

    • If the user decide to add a new Environment into the existing environment, follow the syntax below. Change the respective number of Sub-Env Number and add the required Environment Name and Click the curse outside of the entry window as shown below in Figure 33. NOTE: As explained above, this is a 'FOCUSED OUT' widget and once the user enters the details and steps out, the tool acts based on the details entered.

    • Format/Syntax If user want to Newly Create and Add Environment: (Environment Name)__c

    • NOTE: That is 'double underscore' after the component name followed by c. So that the tool is being indicated saying, user is trying to create new components and add to the respective environment.

    • Format/Syntax If user want to Just Stitch [i.e. Add] Environment: (Environment Name)__s

    • NOTE: That is 'double underscore' after the component name followed by s. So that the tool is being indicated saying, user is trying to just add already existing components and stitch to the respective environment.

    • Once the user press the 'NEXT ENV CFG', the tool takes the user to the next newly added environment, where the user can add required environment details in the GUI entry as shown in the snapshot below [Figure 34]

  • Or, the user can click the 'LOAD ENV CFG' button to load Environment details from the spreadsheet as shown below. When the user clicks the 'LOAD ENV CFG' button, the tool provide the entry window to choose the required spreadsheet to load as shown in the below Figure 35.
  • Once the user clicks the 'PARSE ENV CFG' button, the tool loads up the required environment details from the spreadsheet to the tool as shown in the snapshot below[Figure 36]. As you can notice, based on what type of process the user is doing [i.e. using Create & Stitch or Just Stitch], the tool automatically names the sub-environment under the newly getting added environment accordingly i.e. either __c or __s.
  • Once the environment details are entered and when the user clicks the 'DONE ENV CFG'→ 'GENERATE CODE' button, the tool goes creates & stitches the new environment into the already existing environment codes and make all the necessary changes in every possible file i.e. environment, config files, packages, list files etc.

7. Directory Structure

Below Figure 37 is an example of the directory structure that gets created when the user creates an entire single [or multiple] environment.

  • Agents directory: This is the default agents directory. Under this directory the user can find all the required agents which the user created under the environment. Under the agent you can find the agent related component files like driver, monitor etc. and also separate directory containing the sequences/stimulus.

  • Checkers Directory: This directory contains top level checkers/assertions files etc.

  • Docs Directory: This directory is specially used by the tool to store the environment configuration dump in spreadsheet format.

  • Env Directory: This directory contains all the environment related files as listed below.

    • Environment Config file: For configuring the environment level setup.

    • Environment Macros file: Contains the interface wrapper macro's definition.

    • Env File: Single/Top Level Environment file for multi Environment VIP.

    • Env Package File: This is the Environment package which contains the components used underneath the respective environment.

    • Sequence Item Package: Al the sequence items used inside this environment is kept in this particular package file. This is segregated from the sequences for compilation process.

    • Sequence Package: This package file contains all the sequences created within this environment. The sequence item package is imported inside this package.

    • Test Package: This is the test package which contains all the test written related to the particular VIP.

  • Env_interface Directory: This directory contains the interfaces which is created/used at the environment level.

  • Env_monitors Directory: This directory contains the monitors that is being created inside the environment.

  • Env_sequences Directory: This directory will contain env / test level sequences.

  • Filelist Directory: This directory contains 3 different file list, a) Common file list - listing out the UVM related libraries, b) Environment file list - listing out the environment related directory and files to be compiled, c) Tb top file list - containing the top level module.

  • Models: In this directory user can place their respective RAL Models, Memory models etc.

  • Run Directory: In this directory user can place the necessary run scripts etc. more of a place holder for simulation.

  • Scoreboards Directory: This directory contains the required scoreboard components, checks etc.

  • Scripts Directory: For now this directory has a basic tb_setup.sh file which contains environment variables listing out the directory path for each testbench. User can attach this .sh to their main scripts so that, this sets the required simulation environment variables listing out the directory path.

  • Tb Directory : This directory contains the tb_top module file which the tool creates for the user, so that they can integrate the DUT alongside the environment components.

  • Tests Directory: This directory will be containing all the tests that is being created for the respective VIP.

  • Sub-Environment Directory: Based on the user requirement the sub-environment directory is created inside the top level environment. This sub-environment internally contains/follows the same directory structure as how the top level environment follows.