Getting Started with Stimulus Control Language (SCL)

This page shows the process for creating and attaching a very simple Stimulus Control Language (SCL) program.

A Simple SCL File

SCL files are simply text files; any text editor can be used to create and edit them.

Here is a simple SCL program that will be used as an example in the following sections. Put this program in a file called mySCL.scl:

testbench for "pic18f4620" is
   begin
      process is
         begin
            ADRESH <= 16#BB#;
            wait;
         end process;
   end testbench;

The details of this SCL program, along with the rest of the SCL language, will be described in detail later. For now, it is enough to know that this SCL program will set the ADRESH SFR to 0xBB.

Attaching SCL

This section creates a simple simulator debug session in MPLAB® X IDE and then executes the SCL program created in the last section.

Open MPLAB X IDE and create a simple, non-terminating, PIC18F4620 project using the simulator as the debug tool. Here is a likely program:

  • Create a watch on the ADRESH register and observe that its value is 0x00.
  • Debug Run the program.
  • Open the stimulus window from the MPLAB X IDE main menu: Window > Simulator > Stimulus.
attach1.png
  • In the Stimulus window, click the Attach SCL File button which is located second from top on the left-hand side (highlighted below) and browse to the mySCL.scl file created in the first step.
attach2.png
  • Click the Open button. At this point the mySCL.scl program will be executed.
  • Return to the Watches window and observe that ADRESH is now 0xBB!

Congratulations, you have just executed your first SCL program which injected a value to an SFR during simulator execution!

Attaching in MDB

You can also attach SCL files from the Microchip Debugger (MDB) command line using the stim command:

stim mySCL.scl

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.