22
SCBuilder Page 1 of 22 ver 0.1.6 SystemC™ Builder User Manual Version 0.1.6 HT-Lab © 2015-2016 We like to thank the following contributors in no particular order: Accellera for providing the SystemC reference simulator Accellera for the SCV and UVM libraries AStyle, Artistic Style QScintilla Library, Riverbank Computing Ltd Scintilla, Neil Hodgson Qt framework, The Qt Company CMake, Kitware Tcl Library, Active State MinGW-W64 Project MinGW Project

SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

  • Upload
    others

  • View
    18

  • Download
    0

Embed Size (px)

Citation preview

Page 1: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 1 of 22 ver 0.1.6

SystemC™ Builder

User Manual

Version 0.1.6 HT-Lab © 2015-2016

We like to thank the following contributors in no particular order:

Accellera for providing the SystemC reference simulator Accellera for the SCV and UVM libraries

AStyle, Artistic Style QScintilla Library, Riverbank Computing Ltd

Scintilla, Neil Hodgson Qt framework, The Qt Company

CMake, Kitware Tcl Library, Active State MinGW-W64 Project MinGW Project

Page 2: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 2 of 22 ver 0.1.6

Contents

Introduction .............................................................................................................................................. 3

1. Getting Started .................................................................................................................................... 3

1.1 Getting Help ............................................................................................................................. 4

1.2 Documentation ........................................................................................................................ 4

2. Editor ................................................................................................................................................... 4

3. Project Management ........................................................................................................................... 5

4. Running the Simulation ....................................................................................................................... 6

4.1 VCD display ................................................................................................................................... 7

5. Running the Debugger ........................................................................................................................ 8

5.1 Breakpoints .................................................................................................................................... 8

5.2 Locals ............................................................................................................................................. 9

5.3 Call Stack ..................................................................................................................................... 10

5.4 Control Window ............................................................................................................................ 10

6. Code Coverage ................................................................................................................................. 10

6.1 How to use Code Coverage ......................................................................................................... 11

6.2 Coverage Exclude Pragma .......................................................................................................... 12

6.3 File Exclude ................................................................................................................................. 13

6.4 Generate Coverage Report ......................................................................................................... 14

6.5 Accumulating Coverage ............................................................................................................... 15

7. Additional Tools ................................................................................................................................. 15

7.1 Synthesis ..................................................................................................................................... 15

7.2 Syntax Check ............................................................................................................................... 16

7.3 Code formatter and Beautifier ...................................................................................................... 16

7.4 Structural Window ........................................................................................................................ 16

8. Command Window ............................................................................................................................ 16

8.1 Tcl Scripts .................................................................................................................................... 17

9. Command Line .................................................................................................................................. 17

10. History.............................................................................................................................................. 17

11. Support ............................................................................................................................................ 18

12. Trademarks ..................................................................................................................................... 18

Appendix A: Shortcuts ........................................................................................................................... 19

Appendix B: Library/Tools Versions ...................................................................................................... 19

Appendix C: Tcl commands and Variables ........................................................................................... 19

C1 scb_projectfilelist .......................................................................................................................... 20

C2 scb_directorylist ............................................................................................................................ 20

C3 scb_run_make .............................................................................................................................. 20

C4 scb_run_cmake ............................................................................................................................ 20

C5 scb_build_project ......................................................................................................................... 20

C6 scb_run_simulation ...................................................................................................................... 20

C7 scb_run_translate ......................................................................................................................... 20

Appendix D: UVM .................................................................................................................................. 21

Appendix E: When things go wrong ...................................................................................................... 21

Appendix F: Custom installation ............................................................................................................ 22

Appendix G: Manual un-install SCBuilder ............................................................................................. 22

Page 3: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 3 of 22 ver 0.1.6

Introduction SCBuilder is an Integrated Development Environment (IDE) for the SystemC™ language and associated support libraries. Apart from the SystemC library, SCBuilder is supplied with a pre-compiled Transaction Level Modeling (TLM) library, the SystemC Verification Standard (SCV) library and the SystemC Universal Verification Methodology (UVM) Library. The editor is based on the Scintilla source code editor component, scripting is provided by ActiveStates’ Tcl 8.4 library and the compiler and associated tools are provided by MinGW. A subset of the SystemC language can be translated into VHDL using the included ESL2RTL tool.

1. Getting Started Loading a new design in SCBuilder is straightforward, the user can simply drag and drop files onto the project area or use the Right-Mouse-Buttton (RMB) Add Files Menu option. Step1: Open the Projects menu and select New Project, name the project adder.scb Step2: Open the Windows File Manager and navigate to the Examples\adder directory:

<SCBuilder_Installation>\Examples\Adder

Select all the .h and .cpp file and drag and drop them into the Project Window.

Step3: Next click on the Run button

Figure 1.1: Drag and Drop files into the Project Window

Step4: The simulation results are shown in the Command Window

Page 4: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 4 of 22 ver 0.1.6

Figure 1.2: Text output results are shown in the Command Window

Step5: The VCD waveform can be displayed by clicking on the Toggle Wavewindow button

Figure 1.3: VCD waveform is shown in the VCD Wave Window

1.1 Getting Help Logging bugs, requesting enhancements and asking for help is available via the HT-Lab SCBuilder forum at http://www.ht-lab.com/forum.htm

1.2 Documentation The various documentation associated with each SystemC library and supplied tools can be found under the Help->Documentation menu. The SCBuilder user guide can be shown by pressing F1. Note that a pdf reader is required for the documentation.

Due to copyright issues the SystemC Language Reference Manual (LRM) cannot be supplied with SCBuilder. To allow easy access from the SCBuilder documentation menu please download the pdf file from http://standards.ieee.org/getieee/1666/download/1666-2011.pdf and save the file into <SCBuilder_Installation_Directory>/SystemC/Docs directory.

2. Editor The Editor used in SCBuilder is based on the excellent Scintilla source code editing component. Scintilla is used for many projects including Notepad++, CodeBlocks, Anjuta and many others. SCBuilder implements a number of the Scintilla features such as syntax highlighting for SystemC

Page 5: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 5 of 22 ver 0.1.6

keywords, error indicators from g++, call tips, code folding and code completion (see file <SCBUILDER_HOME>\api\systemc.api)

Font selection, font sizes and other editor features can be configured via the Preferences menu.

Hitting the Full Editor button or pressing F8 will toggle between Project View and Maximum Editor View. The Icon toolbar can also be removed via the Windows menu. Rolling the middle WheelMouse button whilst holding the CTRL key will increase or decrease the font size (normal Windows behavior). This behavior only affect the current selected editor tab, when SCBuilder is restarted the font size will be set as per the Preferences menu font settings.

3. Project Management SCBuilder supports a single active project, workspaces might be supported in future versions if there is demand for it. The projects are saved in a standard XML file with the scb file extension. Source files, header files, include files, Tcl script files, text files and library files can all be dragged and dropped into the project window. The Project tree structure as shown below classifies each file as per their extension.

Figure 3.1: Project Window

Header files (*.h, *.hpp) and Include directories are listed under the Headers section. Note that any directories dropped into the project window are assumed to be include directories. Source files (*.c, *.cpp, *.c++, *.cc) are listed under the Sources section. Libraries dropped into the project window are assumed to be the standard gcc library filename format which start with “lib” and ends with a “.a” extension. Note that the “lib” prefix and extension are removed when listed under the Libraries section. VHDL (.vhd) and (System)Verilog (*.v, *.sc) files are all listed under the RTL section. Tcl scripts (*.tcl) are listed under the Scripts section. Scripts can be executed via RMB Execute menu option.

Page 6: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 6 of 22 ver 0.1.6

Any other files such as CMakelists.txt, VCD (*.vcd) files and readme.txt files are added to the Text section. Instead of dragging and dropping the same actions can also be achieved via a RMB menu options. Some of the file types will give different RMB menu options, RMB clicking on a Tcl script will give the option to execute it, VCD files can be displayed in the Waveform window.

Further Project settings can be found by double clicking on the Settings section in the project tree.

Figure 3.2: Additional Project settings

When a project is saved the directory is flagged as the project directory. The generated CMake file is written to this directory. A build directory with the name “.<project_name>” is created as a subdirectory. The build subdirectory will contain all the intermediate CMake files and the produced EXE file. A clean rebuild can be initiated via the project “Clean Project” menu option, this option will simply delete the build subdirectory and the cmakelists.txt file.

4. Running the Simulation

To run the simulation hit the RUN button After hitting the RUN button the cmakelists.txt file is automatically generated if required, CMake is then executed which creates a Makefile. Make is then executed and if no errors are detected the produced EXE is invoked. Note the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent runs will be quicker. The simulation text output (stdout/stderr) is redirected to SCBuilders’ command window by default. The simulation can also be executed in a separate command prompt (DOS box); this option can be set under the Edit Preferences Run menu options.

Figure 4.1: Simulation Run options

Note there is no separate run manager which means that if the program terminates the command prompt will close (in most case too quick to see the result). In order to see the program’s output (if required) the program must wait before closing. There are many ways this can be achieved, probably

Page 7: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 7 of 22 ver 0.1.6

the easiest one is the include the system(“pause”); command just before the program terminates, example: int sc_main(int argc, char * argv[]) { cout << "Hello World\n" << endl; system("pause"); // Result in ‘Press any key to continue…’

return 0; }

Figure 4.2: Simulation excuted in a separate command prompt

The Executable is written to the build directory and deleted when the project is cleaned.

Command line run arguments can be set via the Edit Preferences menu

4.1 VCD display If the project produces a VCD file then by default the file will be located in the build directory. Depending on the Edit Preferences settings the VCD file can be automatically opened and all the signals displayed in the Waveform window. For this to work the VCD filename should not have a path and have a “.vcd” file extension.

Figure 4.1.1:VCD Display Window

Page 8: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 8 of 22 ver 0.1.6

Waveform Zoom functions are supported via the middle mouse button “stokes” movements. To zoom-in hold the middle mouse button and drag a box around the area of interest. To zoom-out hold the middle mouse button and drag a line from the bottom left to the top right corner. To zoom-full hold the middle mouse button and drag a line from the bottom right to the top left corner. Clicking inside the wave window will display a cursor. The cursor will try to “snap” to the closest edge. Hitting the TAB key will jump forward to the next edge, SHIFT-TAB will jump backwards to previous edge. Signals and whole modules can be dragged from the VCD Signals window and dropped on to the left hand side of the VCD Wave window. Note you need to drop the signals to the left hand side array area and not onto the actual graphical display. Waveform signal radix and color display can be set by RMB clicking on the signal name in the VCD Wave window.

Figure 4.1.2:VCD Signal formatting options

Signals can be expanded into individual bits by selecting the RMB “Expand Signal” option. The reverse can be achieved by selecting “Collapse Signals”. Note that the RMB menu is dependent on the selected signal, thus the expand, collapse and radix options are not shown for bit types. Signals can be removed by selecting the signals and pressing the Delete key. The waveform display settings are saved in an XML file and stored in the project build subdirectory. The filename is the same as the original VCD filename but with the xml extension.

The VCD Wave and VCD Signals windows can be shown/hidden by clicking on the Toggle Wave Window button Individual VCD files can be opened and displayed from the Simulate menu or from the project tree.

5. Running the Debugger

SCBuilder provide a front-end for the gdb debugger. The debugger can be invoked by clicking on the Run Debugger button. If the SHIFT-key is held whilst clicking on the Run Debugger button CMake and make are not invoked, this can be used if the debugger needs to be invoked without recompiling the code.

5.1 Breakpoints By default the debugger will stop on sc_main, this can be disabled under the Edit Preferences menu. Breakpoints can be added either via the GDB Breakpoint window or by clicking in the left side margins

Page 9: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 9 of 22 ver 0.1.6

of the editor. A red circle will appear when a breakpoint has been set. Breakpoint options can be set via the GDB Breakpoint window. RMB click on the breakpoint in the GDB Breakpoint window and select Edit Breakpoint

Figure 5.1: Modify BreakPoint settings

Double clicking on a breakpoint will jump to the file and line number where the breakpoint has been set.

5.2 Locals All locals are automatically displayed in a tree structure when the debugger starts. Currently there is no refinement for SystemC data structures.

Figure 5.2: GDB Locals window

Page 10: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 10 of 22 ver 0.1.6

Warning: some of the SystemC “this” data structures can be very deep, selecting the “Expand All” RMB submenu option can run for a very long time. Use the RMB submenu “stop expanding” to stop the process.

5.3 Call Stack The Call Stack is displayed with the debugger starts.

Figure 5.3: GDB Call Stack Window

Double clicking on any function call will jump to the associated source file and line number.

5.4 Control Window The GDB control window shows the communication between SCBuilder and GDB. This window is primarily for debugging the GDB interface and should in most cases be ignored by the user. However, if required GDB/MI commands can be issued from this window.

Figure 5.4: GDB Log and Command Window

6. Code Coverage

Code Coverage measures which part of your code has been executed, it can be considered as a measure of the completeness of your testbench. There are many Code Coverage metrics but as SCBuilder uses GNU’s gcov in the background only statement coverage (effectively which lines have been executed and which have not) and branch coverage (has each branch executed both the true and false section) are supported. Incomplete code coverage is usually an indication of untested code

Page 11: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 11 of 22 ver 0.1.6

which means the test vectors must be enhanced as bugs are always lurking in untested code (Murphy’s law). Note that Code Coverage is not the same as Functional Coverage, also 100% Coverage is not always feasible or required.

Code Coverage does not work if the simulation is executed in a separate cmd prompt (see Section 4)

6.1 How to use Code Coverage

Running Code Coverage is simple, hit the Coverage Button (which will stay down), then run your

simulation as normal. A new Coverage Tab will open showing the Coverage results after the simulation has finished. See figure 6.1 below. The 3 available metric, statement, branch and function call coverage will be displayed in the Coverage Tab. The editor window will color the individual lines as per the coverage metric:

• Executed statements will be colored green. Not all statements/lines will be green even though they are executed. This is because only so called basic blocks (atomic sections of your code with no jumps in or out) will be instrumented (have a coverage monitor added). The green line coloring can be disabled under the Edit Preferences Coverage section.

• Not executed statements will be colored in red. This is an important coverage and the easiest

to understand.

• Branch statements with missing “true” condition will get an orange background color. This also means that all the statements/lines in the true section will be colored red as they will not have been executed. The orange coloring can be disabled under the Edit Preferences Coverage section.

• Branch statements with missing “false” condition will get a pink background color. Lines in the

false section will be colored red as they have not been executed. The ping coloring can be disabled under the Edit Preferences Coverage section.

• Missed function calls will get the same red background color as missed lines. The coloring can be disabled under the Edit Preferences Coverage section.

Page 12: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 12 of 22 ver 0.1.6

Figure 6.1: Code Coverage

The Coverage Tab shows each individual file’s metric in a bar chart form and list the number of lines/branches/functions executed versus the total number of lines/branches/functions instrumented. In the above screenshot the total statement coverage for the check.h file is 92%, 12 lines were executed out of the 13 instrumented ones, so 1 line has never been executed. For the branch coverage 6 branches were executed and instrumented (T:6/6) and only 1 false branch was executed out of the 6 (F:1/6). Expanding the section will show the individual lines, double clicking on any row will select the file tab and jump to the line in question. The bar charts will turn green for 100% coverage, orange for 80 to 100% coverage and red for less than 80% coverage.

6.2 Coverage Exclude Pragma There are occasions were a particular section or line should be excluded from Code Coverage. This can be achieved by enclosing the section with pragma coverage off/on, example:

} else { // pragma coverage off cout << " Failed, expected sum=" << sumc(3,0) << " co=" << sumc[4] << endl; // pragma coverage on }

Running the Coverage will now ignore the section between the pragmas as shown in figure 6.2; the line coverage is now 100%. Note that the pragmas have file scope only, at the end of the file the coverage is re-enabled even if the last statement is pragma coverage off. The coverage pragma’s must be added to the beginning of the line, the following pragma coverage off will not be recognized:

retvalue=param*2; // pragma coverage off if (param==1) retvalue=1; // pragma coverage on

Page 13: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 13 of 22 ver 0.1.6

Figure 6.2: Code Coverage on/off Pragmas

Pragma off/on can automatically be added to highlighted section via the Edit menu Coverage Off Selection.

6.3 File Exclude Files can be excluded from Code Coverage by creating an ExcludeCoverage.txt file and placing the file in the project directory. Each excluded file should be on a separate line and must have an absolute path. ; Files are excluded from coverage D:\SCBUILDER\systemc-2.3.1\test\coverage\stimgen.cpp D:\SCBUILDER\systemc-2.3.1\test\coverage\testbench.cpp

Files in the project window can easily be excluded by RMB clicking on the file and selecting the Exclude from Coverage menu option. SCBuilder will automatically create the ExcludeCoverage.txt file if it doesn’t exist and add the ExcludeCoverage.txt file to the project.

Page 14: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 14 of 22 ver 0.1.6

Figure 6.3: Exclude file from Code Coverage

6.4 Generate Coverage Report The Coverage results can be written to a text file by using the RMB option from the Coverage Tab and selecting “Generate Report”.

Figure 6.4: Generate Coverage Report

Example Output: ;------------------------------------------------------------------------------ ; Code Coverage Report ; SCBuilder ver:0.1.2 ; 2016-05-15 12:06:43 ;------------------------------------------------------------------------------ Excluded: D:/SCBUILDER/test/coverage/Func/sc_main.cpp File: D:/SCBUILDER/test/coverage/Func/stim.h Coverage Active Hits Missed % Covered ---------------------- ------ ---- ------ --------- Statement Coverage 8 3 5 61.5 Branch Coverage 2 1.5 0.5 75.0 Function Call Coverage 3 2 1 66.7 Detailed Missing Info ---------------------- Missed Line 8 : retvalue=1; Missed Line 9 : foo3(1); Missed Line 38 : return retvalue; No True in Line 7 : if (param==1) { Missed Function in line 31 : int foo3(int param) Excluded Lines ---------------------- Line 16 : int foo2(int param) Line 24 : foo3(1); Line 26 : return retvalue;

Page 15: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 15 of 22 ver 0.1.6

6.5 Accumulating Coverage By default SCBuilder will clear any previous coverage result (deleting *.gcda). This means that each run will show how much coverage was achieved in that particular run. Coverage can be accumulated by unticking the “Clear coverage before each run” option in the Edit Preferences menu.

Figure 6.5: Code Coverage options

With the “Clear coverage before each run” option unticked each run will add to the Coverage result file (*.gcda).

7. Additional Tools

7.1 Synthesis

A subset of the SystemC language can be translated in VHDL using the ESL2RTL tool. Before synthesis the user needs to select the top level file in the project window, this can be done by RMB on the file and selecting Mark Translate Top.

Figure 7.1: RMB Select top level for translation

Page 16: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 16 of 22 ver 0.1.6

After selecting the top level the user can translate the file to VHDL by clicking the Translate button . Additional command line options can be setup via the Edit Preferences menu. For further information on the ESL2RTL tool look under the Help->Documentation->esl2rtl.pdf

7.2 Syntax Check

Clicking on this button will check the syntax of the current selected file. For the syntax check g++ --fsyntax-only is executed. Additional command line options or a different syntax check program can be setup via the Edit Preferences menu.

7.3 Code formatter and Beautifier

Code formatting and beautification is provided by Artistic Style “ACheck”. Formatting rules can be setup via the Edit Preferences menu.

7.4 Structural Window

The structure of the code in terms of signals, ports, processed, sensitivity and instances can be displayed in tree format using the Structure Window. The structure is displayed even with code errors but it may not show all items.

Figure 7.4: structural display of the design

8. Command Window The output for various commands and tools are shown in the Command Window. The g++ warnings and error messages are displayed into this window. If a line number is shown then double clicking on the line should open the file.

Page 17: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 17 of 22 ver 0.1.6

8.1 Tcl Scripts SCBuilder provides a standard Tcl engine provided by ActiveState Tcl library. Tcl scripts can be added to the Project tree and run via a RMB Execute Script option. Scripts can also be executed from the Command window. For all available SCBuilder added commands issue the help command.

Figure 8.1: Tcl Command and Output Window

The Project home directory (containing the build subdirectory and CMakeLists.txt files) is available under the $scb_home variable. More variables are listed in Appendix C

9. Command Line Project and Source files can be loaded via the command line. This makes it easy to create a shortcut which always load a particular project and/or source file or runs a startup script. The following command options are available: command Function Example

-p Load Project scbuilder -p adder.prj --project Load Project scbuilder --project=adder.prj -t Load and Execute Tcl script scbuilder -t start.tcl --tclfile Load and Execute Tcl script scbuilder --tclfile=start.tcl -f Load file into editor scbuilder -f control.cpp --file Load file into editor scbuilder --file=control.cpp

Any filename on the command line without a command are interpreted as per their extension, thus files ending with *.scb are assumed to be project files, *.tcl are Tcl script files and will be executed, all other files are opened in an editor window.

10. History

Version Date Changes

0.1.6 14/08/2016 Several bug fixes, added case conversion, cmd prompt execution 0.1.5 06/08/2016 Enhanced Structural Display, fixed Code Coverage gcda search path 0.1.4 25/06/2016 Add Structural Display, changed to MinGW-W64 gcc 5.3.0 0.1.3 19/06/2016 Removed requirement for TDM-GCC-32 path 0.1.2 30/05/2016 Added Code Coverage 0.1.1 21/05/2016 Added esl2rtl tool, added block comments, some bug fixes 0.1.0 09/01/2016 First Released Version

Page 18: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 18 of 22 ver 0.1.6

11. Support For any support issues please use the HT-Lab forum at http://www.ht-lab.com/forum.htm

12. Trademarks SystemC is a trademark of Accellera Systems Initiative.

Page 19: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 19 of 22 ver 0.1.6

Appendix A: Shortcuts Shortcuts are not yet user configurable. The table below list the non-standard shortcuts. Shortcut Function Note

F8 Toggle Maximise/Minimise editor window CTRL-K Comment out selected text CTRL-SHIFT-K Un-Comment out selected text CTRL-Q Block Comment out selected text CTRL-SHIFT-Q Un-Block Comment out selected text CTRL-R Run Simulation CTRL-SHIFT-U Convert selected/highlighted text to upper case CTRL-U Convert selected/highlighted text to lower case

Appendix B: Library/Tools Versions As of SCBuilder ver 0.1.5 the following libraries and tools versions are included:

Library Version Note

SystemC/TLM 2.3.1 SCV 2.0

SC-UVM 1.0 Public draft Tcl 8.6.4

Tool Version Note

GNU 5.3.0 32 bit MinGW-w64 version CMake 3.5.0-rc2 AStyle 2.05.01 ESL2RTL 0.8 Clang++ 3.8.0

Appendix C: Tcl commands and Variables Table C.1 list the current Tcl variables. Note that the variables are set when SCBuilder starts up, changing the setting under the Preferences window requires a restart to update the variables. Variable Returned String

scb_home SCBuilder installation home directory scbsystemc_home SystemC home directory scbscv_home SCV home directory scbuvm_home UVM home directory scb_version SCBuilder Version scbproject_home Active project directory (containing <project>.scb file and .build directory

Table C.1: Tcl preset variables

Page 20: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 20 of 22 ver 0.1.6

Command Arguments

scb_projectfilelist Sources, Headers, RTL, Scripts, Libraries or Text scb_directorylist Sources, Headers, RTL, Scripts, Libraries or Text scb_run_make scb_run_cmake scb_build_project scb_run_simulation scb_run_translate

Table C.2: Tcl SCBuilder commands

C1 scb_projectfilelist This command returns a Tcl list of all the filepaths of the requested Project Tree Section. Thus if you want to get a list of all the headers files you issue the command: Cmd>scb_projectfilelist Headers # {D:/SCBuilder/Examples/Adder/adder.h} {D:/SCBuilder/Examples/Adder/check.h} {D:/SCBuilder/Examples/Adder/stim.h}

C2 scb_directorylist scb_directorylist <section> returns a unique list (no duplicates) of all the directories used. Cmd>scb_directorylist Headers # {D:/SCBuilder/Examples/Adder}

C3 scb_run_make Invokes make.exe

C4 scb_run_cmake Invokes cmake.exe

C5 scb_build_project

Performs the same actions as if the build button has been clicked. 1 Creates the .build directory 2 Creates cmakelists.txt if required 3 Invokes cmake.exe 4 Invokes make.exe

C6 scb_run_simulation

Performs the same action as if the Run button has been clicked. 1 same as scb_build_project 2 executes the produced EXE file.

C7 scb_run_translate

Performs the same action as if the Translate button has been clicked.

Page 21: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 21 of 22 ver 0.1.6

Appendix D: UVM UVM Libraries are not linked in by default. To use the UVM double click on the Settings icon in the project window and tick the “Add UVM Library” option. Note that the SystemC-UVM make check did not complete successfully, so use with caution!

Appendix E: When things go wrong If SCBuilder misbehaves or hangs first clean the project (Project->Clean Project), this will delete the build directory and the CMakelists.txt file. If the GUI misbehaves delete the scbuilder.ini file in the SCBuilder home directory. This file contains the GUI setting, previous project history and various others settings. The file will be re-created when SCBuilder starts. Make sure <SCBUILDER Installation Directory> is first in the search path, some programs like GPG4Win have their own libstdc++-6.dll file which is incompatible with the one supplied with SCBuilder. If running the exe file produces no output in the command window then run the exe in a CMD prompt, for some reason missing dll’s are not always reported when the exe is invoked from SCBuilder. During installation some virus checkers such as Avast will stop the executable during a deep scan, this could also stop SCBuilder starting after installation, when the installer has finished, SCBuilder should start without any issues.

For the Edit Preferences menu avoid using spaces in path and use forward ‘/’ slashes for directory separations. Check that scbuilder/bin and scbuilder/mingw32/bin are first in the search path. If all else fails report the issue on the SCBuilder forum.

Page 22: SystemC™ Builder - HT-LabNote the first time CMake is invoked it builds up the CMake cache structure and test the compiler/build environment which result in an initial delay. Subsequent

SCBuilder Page 22 of 22 ver 0.1.6

Appendix F: Custom installation During installation the user can select not to install the MinGW32 environment, CMake and pre-compiled versions of the SystemC libraries (SystemC, SCV and UVM). If a custom compiler is going to be used then it must be gcc based as SCBuilder relies on certain file formats such as gcov for coverage and issues gdb mi2 commands for debugging. Make sure the bin directory is in the search path so that scbuilder can find the various gnu executables. A different CMake version can be used by unticking the CMake option during installation and make sure the new version is in the search path. Custom version of the SystemC and associated libraries can be set up via the Edit Preferences menu. The SCBUILDER_HOME environmental variable must be set and point to the SCBuilder installation directory. If the values are not set or not pointing to a valid SCBuilder directory the application will not start.

Figure D: SystemC library path

The Target Name forms part of the library, thus for the above SystemC settings, SCBuilder assumes the SystemC library to be located in: <SCBuilder_Installation_Directory>/lib_<target_name>/libsystemc.a The home directory paths are reflected in tcl variables.

Appendix G: Manual un-install SCBuilder 1) Delete the SCBuilder directory and all subdirectories 2) Remove SCBUILDER_HOME from the environmental variable list 3) Remove the SCBuilder\bin from the path environmental variable 4) Remove the SCBuilder\TDM-GCC-32\bin from the path environmental variable (only required for SCBuilder 0.1.2 or earlier) 5) Remove the SCBuilder\mingw32\bin from the path environmental variable (only required for SCBuilder 0.1.5 or later)