offroad Posted December 25, 2013 Report Share Posted December 25, 2013 Hi, here is an example project (download) that shows how tocreate a ZPU on a Papilio Pro boardcompile a C program (gcc)insert the bit streamsimple IO (no wishbone bus)integrate the ZPU into Verilog (rewriting the top-level file in VHDL would be trivial.Anything that's not essential is removed.For those who haven't yet met one: The ZPU is a tiny microcontroller with a GCC development environment. Most of the code is borrowed from here.My contribution is to remove stuff to the point where it barely works - it's still complicated enough. zpu_config.vhd was largely rewritten.There is one clock input, one LED output, and that's all. Cygwin is required to compile C code. The ZPU compiler binaries are included. Step 1: Check that the pre-built binary worksStart Papilio loader;select "uploadme.bit" as "Target .bit file"."Write to: FPGA" is fastestOn completion, the LED should blink slowly Step 2: Compile your own binaryEdit c-code/main2.c (there are 3 blink variants to choose from, edit #if... /#elif)Run build.sh. You may have to edit it once and set correct pathsIf successful, the new binary is copied to the bitstreamrepeat Step 1 and the LED should blink differently.Step 3: Rebuild the project (Xilinx ISE 14.7 web edition)For example, in src/zpu_config.vhd, changeconstant maxAddrBitIncIO : integer := 15;to 16.Now the C code won't control the LED anymore, until it is changed fromvolatile unsigned int* io = (unsigned int*)0x00008000;tovolatile unsigned int* io = (unsigned int*)0x00010000; Link to comment Share on other sites More sharing options...
Jack Gassett Posted December 26, 2013 Report Share Posted December 26, 2013 offroad, thank you for putting this example project together. I just wanted to make sure that you have seen Alvaro Lopes' ZPUino? Its a ZPU derivative for the Papilio that is also based on ZPU. Jack. Link to comment Share on other sites More sharing options...
offroad Posted December 28, 2013 Author Report Share Posted December 28, 2013 Thanks for the hint! I had a quick look, looks good, well documented.I guess I'd use it for any "real" project. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.