PicoBlaze C Compiler (PBCC) is a cross-compiler of C language for 8-bit soft-core Xilinx PicoBlaze-3 processor. PBCC is based on Small Device C Compiler (SDCC) as a new port for this compiler framework. The current version is possible to run on Windows 32-bit Cygwin platform and Unix-based systems.
VLAM supports the work on PBCC. Virtual Laboratory of Microprocessor Technology Application (VLAM) is a research project founded by Czech Ministry of Education, Youth and Sports. The project has been approved under National research program II with number MSMT 2C06008. The main goal is to introduce and implement new ways of the education in the embedded system topics.
By downloading any of the following files, you agree with its GNU GPL v3 license (see GNU General Public License 3):
--port-kw=PORTARRAYID
to set the keyword used to identify the virtual array to access PicoBlaze ports using INPUT/OUPUT instruction from C code by setting
PORTARRAYID[0] = 0x20;
or reading
int val = PORTARRAYID[255];
To use this code, add to the begining of your source
extern volatile char PBLAZEPORT[];
As the compiler still has many bugs and missing features, it is good to know them:
To make better overview what can be used in C language and validly processed by PBCC, see following code examples:
void __port_write(volatile char port, volatile char arg) { unsigned volatile char p; unsigned volatile char a; p = port; a = arg; __asm OUTPUT _a, _p __endasm; } #define LCD_wr(arg) __port_write(0x40, (arg));__port_write(0x41, 01) int main(void) { char ch = 0x41; LCD_wr(ch); return 0; }
PicoAsm is open source assembler for Xilinx PicoBlaze-3 from George Smith (see the homepage). We improved this tool to be able to work properly with VLAM IDE and its Makefiles.