Swordfish Simulator?

Coding and general discussion relating to the compiler

Moderators: David Barker, Jerry Messina

Post Reply
TonyR
Posts: 75
Joined: Fri Jan 14, 2011 11:49 pm
Location: Sydney
Contact:

Swordfish Simulator?

Post by TonyR » Sat Nov 22, 2014 6:00 am

Is there a way to run an SF program without loading it on chip hardware?

I've got a GPS GSM project with lots of SF maths and it would be wonderful/quicker to be able to test it without repeatedly programming the target device.

User avatar
Coccoliso
Posts: 152
Joined: Mon Feb 17, 2014 10:34 am

Re: Swordfish Simulator?

Post by Coccoliso » Sat Nov 22, 2014 8:44 am

Hello,
You can use Proteus 8 with ISIS but not all hardware is simulated .. there are many PIC including some LCD and the KS0108 but do not think GSM modules or specified HW. You can always check the controls and displays them on the display instead of sending them to the HW.

Jerry Messina
Swordfish Developer
Posts: 1470
Joined: Fri Jan 30, 2009 6:27 pm
Location: US

Re: Swordfish Simulator?

Post by Jerry Messina » Sat Nov 22, 2014 11:27 am

You can do source-level debugging using Microchip's MPLAB, which lets you use the free simulator (MPSIM) or one of the ICD debuggers (PICKit2/3, ICD3, etc).
It can be downloaded here MPLAB_IDE_8.92

Be sure to use the older MPLAB in that link, and not the newer MPLABX

There are some notes on the wiki about using Swordfish with MPLAB:
Using Swordfish with MPLAB
In-Circuit Debugging (ICD) with MPLAB

When setting up the debugger in MPLAB, just use DEBUGGER...SELECT TOOL and select MPLAB SIM.
You can skip the section "Software Requirements"... that only applies to using the ICD hardware debuggers.

I use it all the time to debug code algorithms w/out any hardware, and then once you have your board you can use the PICkit to run your program and debug it on the real hardware. MPSIM doesn't include features to simulate external hardware like LCDs and such, but it does have a feature to let you pipe UART1 IO to a window/file.

It also lets you simulate the ADC, and has a logic analyzer that you can use to view port pin outputs.

TonyR
Posts: 75
Joined: Fri Jan 14, 2011 11:49 pm
Location: Sydney
Contact:

Re: Swordfish Simulator?

Post by TonyR » Sat Nov 22, 2014 7:13 pm

Great! Actually I thought the answer would be no. Thanks guys, I will try it today.

In case you might be interested I developed a GSM Marine Transponder, 2kW Induction Heater, RS485 Touch Screen Terminal (KS108), Wifi Drug Reminder Device and 3 Axis Magnetic Anomaly Detector so far with SF, I'd be very interested to know what projects you might have done? its nice to know one is not alone!

AndrF
Posts: 8
Joined: Fri Feb 06, 2015 5:50 am

Re: Swordfish Simulator?

Post by AndrF » Tue Apr 12, 2016 10:50 am

Coccoliso wrote:Hello,
You can use Proteus 8 with ISIS but not all hardware is simulated .. there are many PIC including some LCD and the KS0108 but do not think GSM modules or specified HW. You can always check the controls and displays them on the display instead of sending them to the HW.
Proteus 8.3 SP2 the plagin is not installed :(
Attachments
1.png
1.png (25.43 KiB) Viewed 4045 times

User avatar
David Barker
Swordfish Developer
Posts: 1214
Joined: Tue Oct 03, 2006 7:01 pm
Location: Saltburn by the Sea, UK
Contact:

Re: Swordfish Simulator?

Post by David Barker » Tue Apr 12, 2016 4:48 pm

I think Labcenter have gone down the route that everything should be centered around their IDE, which means they have pulled support for a standalone simulator (ISIS). I think the only viable future is source level debugging, as Jerry previously mentioned. This thread may also be of use:

http://sfcompiler.co.uk/phpBB3/viewtopi ... lit=mplabx

AndrF
Posts: 8
Joined: Fri Feb 06, 2015 5:50 am

Re: Swordfish Simulator?

Post by AndrF » Wed Apr 13, 2016 10:27 am

Compilers in Proteus 8.3 SP2:
Attachments
2016-04-13_13-19-05.png
2016-04-13_13-19-05.png (118.3 KiB) Viewed 4026 times

Post Reply