i am a new person in the FPGA field. I have just made something with IC from Xilinx( just make a FPGA'sboard at home). I know it worked well when i check it with some program.I started to learn to control it.It is said that There is a processor inside FPGA called Picoblaze. I try to program for it, but i have no following thing.
I can program with the C software, then use a C compiler to compile it then load into FPGA. I do not know if this process is Ok or not. i also want to know when programming in C, Should i use the standard C language or Use the Picoblaze languge but written in C.
does everyone make me clear somethings mentioned above. I would like clarify why i can asked the stupid questions. I did them because i am only a hardware designer.
Programming Picoblaze in C might not be the best route for now (there is no good C compiler available). However, programming the picoblaze using its assembly language is quite straightforward.
--
Reply to nico@nctdevpuntnl (punt=.)
Bedrijven en winkels vindt U op www.adresboekje.nl
In article , snipped-for-privacy@puntnl.niks (Nico Coesel) writes: |> Programming Picoblaze in C might not be the best route for now (there |> is no good C compiler available). However, programming the picoblaze |> using its assembly language is quite straightforward.
While we are at it, is there any kcpsm-compatible commandline assembler for Linux, especially for PB V3? I've found one in an KDE IDE, but that doesn't work with makefiles. It shouldn't be too hard to write one in the lunch break, but if it already exists...
I've tried to run kcpsm3.exe with wine, but that didn't work for some reason...
--
Georg Acher, acher@in.tum.de
http://www.lrr.in.tum.de/~acher
"Oh no, not again !" The bowl of petunias
I found a C compiler for picoblaze, it have a manual and some examples. But i try to compile it following the direction in the manual, it was not work. It always noticed "open failes" . i also write a simple C program to test but nothing can make it run.
I also try to write a email to author, but he did not answer yet. Can anyone use it and get good results?
1.) There "is" no PicoBlaze processor into any FPGA unless you have synthesized the PicoBlaze sources (and the rest of your design) and downloaded the bitstream into the FPGA.
2.) As far as I know there is only one C-Compiler available for the PicoBlaze: PCCOMP from Francesco Poderico. This one supports only Picoblaze for Spartan3 and Virtex II FPGAs.
So, which kind of FPGA are u using on your board?
Which "open fails"? The open for reading your source code or have you used an open() function in your source? In the first case you probably made some mistake while invoking the compiler. In the second case you just forgot that you are writing code for a simple microcontroller. There is nothing to open.
Have a look at the manual. The allowed statements are as reduced as the PicoBlaze itself is. So take good care what you are programming. Not everything is allowed or meaningful when using PCCOMP.
About the other questions: You can run the KCPSM.EXE under linux by using some DOS emulation program. I'm running it under wine :
wine kcpsm.exe
I'm not sure about the KCPSM3.EXE. Either your WINE is not up to date, or maybe you forgot to put the ROM_form.* templates into the correct path?
Thank you very much for your idea. i am using a IC XC3S400. I know it get a Picoblaze inside. First, i only test program PCCOOMP to sure it runs well. "open failed" means PCCOMP can not open file( for example, I downloaded a file from the place i loaded PCCOMP soft). I open these files with Borland C, and they are Ok. But when i compiled in PCCOMP , it always failed.
I have no occassion to get a code to load into Picobalze.
By the way, i think you get much knowledge about FPGA, can you make me clear somethings? i would like to program for Picoblaze In C, i have to include "Spartan3.h" to be able to use Picoblaze languege in C, wouldn't I? Please tell me with my stupid questions.
Hi Him, Today I have tested PCCOMP 1.8.4 with two of its examples (sqrt and fibonacci)
Two things have to be taken care of: the header files have either to be placed in a subdirectory called lib, or the includes hav to be changed to e.g. #include "spartan3.h" if the header files are in the same directory as the source file. whatever you prefer.
i used the following commandline:
pccomp -c -s example_sqrt.c
pccomp -c -s ex_fibnacci_s3.c
there was a little error in the fibonnacci source: on line 69 you have to add a missing #endif but then it compiles without errors.
The files SQRT.VHD/V/MEM etc. and FIBO.VHD/V/MEM etc. are the sources for your Picoblaze-ROM. Depending on the flow you use you have to include the right one to your ISE-Project.
Now you can implement your design and download the bitfile to your FPGA.
I don't know which source you have tried. The above examples work just fine.
First, thank you very much for your idea. I got some interestings thing from you. I have just come back my work from long holiday in my country. I compile 2 example file. Example_Sqrt is ok, But i have problems with fibonacci file. when i compile file fibo.psm i have the following screen:
01E LOAD ZH, 00
01F SUB YL, 01
020 STORE ZL, (YL)
021 FETCH ZL, _N
022 SUB YL, 01
023 STORE ZL, (YL)
024 CALL _outchar
025 ADD YL, 02
026 ; Fibonacci_result=Fibonacci(N); // calculate fibonacci of N
026 FETCH ZL, _N
027 SUB YL, 01
028 STORE ZL, (YL)
029 CALL _Fibonacci
ERROR - Address is not 3-digits: _Fibonacci
Provide a correct absolute address in range 000 to 3FF or a matching line label. Note that labels are case sensitive.
Please correct and try again.
KCPSM3 complete.
Can you show me clearly again!
I know, my questions may be stupid. But i think" wanting to know must to ask"
Hi Him, the fibo.psm assembles without errors on my machine. maybe you have put the #endif in the wrong line? Here is the version of fibonacci.c I used:
//////////////////////////////////////////////////////////////// // KCPSM3 ONLY // HOW EASY IS TO BE AN FPGA DESIGNER !!!
#define use_scr_ram
//////////////////////////////////////// // spartan3.h is a library that must be used if yoy want to use scracthpad memory // #ifdef use_scr_ram #include "spartan3.h" #endif // //
//#define ONE #define TWO //#define THREE
// Fibonacci example // the sequence of Fibonacci is: // //1 1 2 3 5 8 13 21 34 55 89 144 233 377 610 987 1597 etc. char N; char Fibonacci_result; char i,ii,Last; char Next,Answer;
char Fibonacci(char N);
void main(){ // char Next,Answer; #ifdef use_scr_ram N = inchar(0); // read N from IO addr.0 outchar(0xaa,N); // test Fibonacci_result=Fibonacci(N); // calculate fibonacci of N outchar(0,Fibonacci_result); // write Fibonacci(N) at address 0
// the next loop calculta Fib(2) and write in 2, then calculate Fib(3) and write in 3, etc. for (ii=2; ii
ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here.
All logos and trade names are the property of their respective owners.