simics

How do I use the "Simics Training" and "QSP CPU" packages?


1 - There's a "Simics Training" package shown in the package manager, and a "targets\simics-user-training" and " targets\workshop-01". Where is the documentation about starting up and going through these trainings? (I assume this is different than just the normal "my-simics-project-1/documentation.html" documentation, because that documentation doesn't ever reference either of those targets in the Getting Started section)

2 - In the documentation there's a line: "The QSP-x86 package contains a legacy processor core which is used by default in the included simulated machines. To use more modern processors, the package QSP-CPU can be installed, which contains recent processor cores." How does one actually use the QSP-CPU to select a different CPU to be simulated? (Related: I see in the release notes a bunch of mentions of ICH10. Is that what the default QSP-x86 "targets\qsp-x86\firststeps.simics" is simulating? Ideally I'd like to simulate at least a PCH-based system.)


Solution

  • #Point 1 If you check the doc/ folder in your SImics project, you should have the lab instructions. It is a bit inconsistent that they are stand-alone PDFs, but that comes from how they are built currently. Look for nut-001 and workshop-01.

    #Point 2 (and how come StackOverflow does not have heading styles? You can really use those to write nicely structured answers)

    If you have installed everything, use the scripts "qsp-atom-core.simics" etc. to run the standard QSP setup but with a different type of core. For example:

    > simics.bat targets\qsp-x86\qsp-client-core.simics
    

    To see how that core is selected, open the script file. For example, to look at the client core script, first type/cat the trampoline script in the project. Then, go and open or cat or type the script file itself. For example:

    C:\Users\jengblo\simics-projects\my-simics-project-5>type targets\qsp-x86\qsp-client-core.simics
    # Auto-generated file. Any changes will be overwritten!
    decl { substitute "C:\\Users\\jengblo\\AppData\\Local\\Programs\\Simics\\simics-qsp-cpu-6.0.1\\targets\\qsp-x86\\qsp-client-core.simics" }
    run-command-file "C:\\Users\\jengblo\\AppData\\Local\\Programs\\Simics\\simics-qsp-cpu-6.0.1\\targets\\qsp-x86\\qsp-client-core.simics"
    

    Given that trampoline, go to the actual script file:

    C:\Users\jengblo\simics-projects\my-simics-project-5>type C:\\Users\\jengblo\\AppData\\Local\\Programs\\Simics\\simics-qsp-cpu-6.0.1\\targets\\qsp-x86\\qsp-client-core.simics
    # In order to run this, the QSP-x86 (2096), QSP-CPU (8112) and
    # QSP-Clear-Linux (4094) packages should be installed.
    
    decl {
    ! Script that runs the Quick Start Platform (QSP) with a client processor core.
    
     params from "%simics%/targets/qsp-x86/qsp-clear-linux.simics"
      default cpu_comp_class = "x86-coffee-lake"
      default num_cores = 4
    }
    
    run-command-file "%simics%/targets/qsp-x86/qsp-clear-linux.simics"
    

    And note how the "cpu_comp_class" parameter is set. The way to find available such classes in a bit obscure, admittedly. In your running Simics session started from the client-core script (for example), check the types of the components inside the motherboard.

    simics> list-components board.mb
    ┌─────────┬─────────────────────────┐
    │Component│Class                    │
    ├─────────┼─────────────────────────┤
    │cpu0     │processor_x86_coffee_lake│
    │gpu      │pci_accel_vga_comp       │
    │memory   │simple_memory_module     │
    │nb       │northbridge_x58          │
    │sb       │southbridge_ich10        │
    └─────────┴─────────────────────────┘
    

    Note the class of the cpu0 component. To find other classes from the same pattern, use the list-classes command:

    simics> list-classes substr = processor_x86
    The following classes are available:
    ┌─────────────────────────────┬──────────────────────────────┐
    │            Class            │      Short description       │
    ├─────────────────────────────┼──────────────────────────────┤
    │processor_x86QSP1            │N/A (module is not loaded yet)│
    │processor_x86QSP2            │N/A (module is not loaded yet)│
    │processor_x86_airmont        │N/A (module is not loaded yet)│
    │processor_x86_broadwell_xeon │N/A (module is not loaded yet)│
    ...
    

    You can then build a custom script to start with a given core. Follow the pattern of "qsp-client-core.simics" as found in the installation. Copy that file into your project, and modify the core class as well as other parameters.