====== PicoBlaze C Compiler (PBCCv1, 2010-02-15) ====== **[[.pbcc|New version PBCCv2 is here!]]** This article is just a history. 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) front-end and back-end written in Pharo Smalltalk. The current version is possible to run on Windows 32-bit platform, but we are working on the portability to Unix-based systems. ===== Requirements ===== * [[http://www.microsoft.com|Microsoft]] Windows XP/Vista/7, 32-bit platform * [[http://www.pharo-project.org/pharo-download|Pharo Smalltalk]] (binary included in the package) * [[http://sdcc.sourceforge.net|Small Device C Compiler with PicoBlaze port]] (binary included in the package) * [[http://www.xilinx.com/picoblaze|Xilinx PicoBlaze Assembler]] * [[http://www.mediatronix.com/pBlazeIDE.htm|pBlazeIDE]] (simulation tool for Windows, optionally) ===== Download ===== * version 2010-02-15 (first public version, alfa (SVN rev #181, MC rev #89)) * Binary package: {{:projects:vlam:pbcc:pbcc-bin-win32-2010-02-15.zip}} * Front-end Source: {{:projects:vlam:pbcc:sdccpb-src-2010-02-15.zip}} (GNU GPL v2) * Back-end Binary: {{:projects:vlam:pbcc:pbccb-bin-win32-2010-02-15.zip}} (Freeware) * version 2009-01-01 (see internal private pages) ==== Add-ons ==== * {{:projects:vlam:pbcc:pspad_kcpsm3.zip|KCPSM3 and PBCC JSON Syntax Highlighting Files}} for [[http://www.pspad.com/en/|PSPad 4.5.3]] (updated 2010-02-06) * inluding Colors configuration for KCPSM3 and PBCC JSON Highlighters (partial copy of %LOCAL_USER%\Roaming\PSpad\PSPad.INI), merge it with you PSPad.INI or just set the configuration in GUI ===== Documentation ===== * {{:projects:vlam:pbcc:pbcc_user_manual.pdf|PicoBlaze C Compiler User Manual}} (revision 1, 2010/02/07) * [[http://sdcc.sourceforge.net/doc/sdccman.html/|SDCC User Manual]] * [[http://www.xilinx.com/support/documentation/ip_documentation/ug129.pdf|Xilinx PicoBlaze-3 Processor Manual]] ==== Known bugs ==== As the compiler still has many bugs and missing features, it is good to know them: * Global variables not supported yet (working on register allocation optimizations along with the support of global variables) * Optimized switch does not work (JUMPTABLE) * Missing: Get highest bit, get value at address, pointer set, address of (SDCC iCodes) * Inlining not supported yet ==== Code Examples ==== 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; } * Set of {{:projects:vlam:pbcc:demos_tests.zip|Examples to download}} (14 files). ===== License ===== * Back-end part is under "Freeware" license (see EULA.txt in the package) * We are negotiating the use of some open source license with our partners at the moment. * Front-end part is inherited from SDCC as [[http://www.opensource.org/licenses/gpl-2.0.php|GPL version 2]] (see COPYING in the package) ===== Author ===== * [[krivka@fit.vutbr.cz|Zbyněk Křivka]] ([[http://www.fit.vutbr.cz/~krivka/index.php.en|See homepage]]) * Feel free to [[krivka@fit.vutbr.cz|contact me]], if you have some suggestions.