Getting Started with SCL

This page shows the process for creating and attaching a very simple 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 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 (second from top on left hand side), 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 observer that ADRESH is now 0xBB!

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

Attaching in MDB

You can also attach SCL files from the MDB command line using the stim command:

stim mySCL.scl

20th Annual
Microchip MASTERs Conference 2016
Register now - Deadline: July 29

JW Marriott Desert Ridge Resort-Phoenix, AZ

© 2016 Microchip Technology, Inc.
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.