What is the smallest size ROM you can run PAWN on?

145 views
Skip to first unread message

Dennis Muhlestein

unread,
Aug 25, 2014, 4:19:29 PM8/25/14
to pawns...@googlegroups.com
Hello,

I have 32k of ROM to work with.  I could perhaps have 64k if I decide Pawn is really worth it.  I'd love a simple scripting interface for our hardware to provide user customizable runtime behavior.  

Anyway, I compiled just the Pawn amx.c with only amx_Init and amx_Exec support into a firmware I've been testing.  The result looks like approximately 60k worth of additional size (but I haven't yet added any support for my hardware or any additional support for running the scripts.  

Question is, am I on the right track with the target size?  If so it seems like Pawn is slightly too big for my needs.  Perhaps I missed something during configuration that would make things smaller.  Here are the defines I used:

-DAMX_ANSIONLY -DAMX_EXEC -DAMX_NO_OVERLAY -DAMX_NO_MACRO_INSTR -DAMX_NO_PACKED_OPC
And also -Os (for size)

Thanks for any input
-Dennis

Dan Christian

unread,
Aug 25, 2014, 6:41:49 PM8/25/14
to pawns...@googlegroups.com
What processor are you using?
-Dan



--
You received this message because you are subscribed to the Google Groups "Pawn Scripting Language" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pawnscript+...@googlegroups.com.
To post to this group, send email to pawns...@googlegroups.com.
Visit this group at http://groups.google.com/group/pawnscript.
For more options, visit https://groups.google.com/d/optout.

Dennis Muhlestein

unread,
Aug 25, 2014, 6:42:31 PM8/25/14
to pawns...@googlegroups.com
Microblaze softcore for a Spartan 6 FPGA.
You received this message because you are subscribed to a topic in the Google Groups "Pawn Scripting Language" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pawnscript/SvlFMMWTp5Y/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pawnscript+...@googlegroups.com.

Petteri Aimonen

unread,
Aug 26, 2014, 1:21:12 AM8/26/14
to pawns...@googlegroups.com
Hi,

> I have 32k of ROM to work with. I could perhaps have 64k if I decide Pawn
> is really worth it. I'd love a simple scripting interface for our hardware
> to provide user customizable runtime behavior.
>
> Anyway, I compiled just the Pawn amx.c with only amx_Init and amx_Exec
> support into a firmware I've been testing. The result looks like
> approximately 60k worth of additional size (but I haven't yet added any
> support for my hardware or any additional support for running the scripts.

The size depends heavily on CPU. On Cortex-M3 with the assembler version
of amxexec, I have the Pawn core in about 15 kB and a complete system
with platform libraries in 32 kB.

Here are my compilation flags, in case it helps:
-DAMX_ASM=1 -DAMX_ANSIONLY -DAMX_NO_PACKED_OPC=1 -DAMX_NO_DYNALOAD=1

Perhaps you could try to check each .o size (using the 'size' tool or
similar, not file size) to see what is taking up the space.

--
Petteri

Dennis Muhlestein

unread,
Aug 26, 2014, 12:51:42 PM8/26/14
to pawns...@googlegroups.com
Thanks for the info, so if I use your flags I get amx.o=54K
If I use my flags to start amx.o=23K,
So if I remove Amx_init and add amx_asm so I have this:

-DAMX_ASM=1 -DAMX_ANSIONLY -DAMX_EXEC -DAMX_NO_OVERLAY -DAMX_NO_MACRO_INSTR -DAMX_NO_PACKED_OPC
amx.o goes down to under 9K.  That seems like the range I could start being able to use it.

I'm not familiar with Pawn enough to know if that's a good combination though.  I thought you needed amx_init and exec both to start up a script.  Perhaps I'm missing something there.  Not sure if any other libraries are required (like amxcore for instance for what I need.  Also I'm not sure what the ASM flag does yet but it does cut down a lot on the size.

Petteri Aimonen

unread,
Aug 26, 2014, 1:17:47 PM8/26/14
to pawns...@googlegroups.com
Hi,

> Also I'm not sure what the ASM flag does yet but it does cut down a
> lot on the size.

It assumes that you provide a separate assembler implementation of the
main Pawn virtual machine. If you don't have one, it will reduce the
size but result in a linker error eventually :)

--
Petteri
Reply all
Reply to author
Forward
0 new messages