greg samsa Posted August 21, 2014 Report Share Posted August 21, 2014 Hi All,I've been getting back into some Papilio development again lately and have been very happy to see all the improvements to the SoC ecosystem. I've been able to reproduce the pwn tutorial (very helpful!) and now want to add a toy 'adder' (add two registers and store the result in a third) component. I'm struggling to understand the behavior of async vs sync from the perspective of software running on zpuino. With an async result do you poll for a ready bit, vs having the cpu block on sync? Are there software examples of the two, or best practices to follow? The default template is async, and the vhdl code makes sense, I'm just wondering… for the adder component described above, should I be using sync? (I've seen the examples of that in another thread). Thanks in advance,-Greg Quote Link to comment Share on other sites More sharing options...
alvieboy Posted August 21, 2014 Report Share Posted August 21, 2014 You should use sync (registered) if possible, cause it can give you better timing results, at the expense of one clock cycle. I can write you an example if needed. Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted August 21, 2014 Report Share Posted August 21, 2014 Hello Greg, I believe the example in the latest version of the ZAP IDE for a Wishbone peripheral is sync. Jack. Quote Link to comment Share on other sites More sharing options...
greg samsa Posted August 22, 2014 Author Report Share Posted August 22, 2014 Thanks Jack and Alivie,Makes perfect sense now - I think I misread the template (https://github.com/GadgetFactory/Papilio-Schematic-Library/blob/master/examples/MegaWing_Logicstart/Libraries/Wishbone_Peripherals/TEMPLATE_zpuino_wb_Wishbone.vhd), and got confused. I'll post any progress I make here.-Greg Quote Link to comment Share on other sites More sharing options...
greg samsa Posted August 27, 2014 Author Report Share Posted August 27, 2014 Success!Very simple example, but was still fun to get it working. I attached the adder to wishbone slot 9 after editing the schematic symbol, and followed the template Arduino code to set two registers, and read the result from the third.For being a toy example, it helped clear up a *great* deal on how the software interacts with the hardware for me. Here's a gist of the arduino and vhdl code - https://gist.github.com/gregor-samsa/36d32adbaec8330c2663 . Thanks for the help again,-Greg Quote Link to comment Share on other sites More sharing options...
Jack Gassett Posted August 28, 2014 Report Share Posted August 28, 2014 Glad to hear you got it working. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.