This is an old revision of the document!


PicoBlaze C Compiler

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.

About VLAM Project

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.

History

Requirements

Download

By downloading any of the following files, you agree with its GNU GPL v3 license (see GNU General Public License 3):

  • version 2011-10-?? (in progress)
    • Changes:
      • Several bug fixes concerning the comparison of signed integers
  • version 2011-09-01 (fourth public version, beta (SVN rev #58), based on SDCC 3.0.1)
    • Binary package: pbccv2-bin-win32-cygwin-2011-09-01.zip (4.9 MB)
    • Source code: pbccv2-src-2011-09-01.zip (9.3 MB)
    • Changes:
      • new command-line parameter
        --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];
      • fixed bug with duplicity of labels

Add-ons

Documentation

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
  • Problems with passing array as a function argument

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;
}

License

Author

    • Feel free to contact me, if you have some suggestions.
  • Jakub Horník
    • Main programmer of the SDCC port written in C language (as a part of his Master thesis)
projects/vlam/pbcc/pbcc.1319404081.txt.gz · Last modified: 2011/10/23 23:08 by krivka
 
Except where otherwise noted, content on this wiki is licensed under the following license: CC Attribution-Noncommercial-Share Alike 4.0 International
Recent changes RSS feed Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki