greg samsa

async in wishbone template

6 posts in this topic

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

Share this post


Link to post
Share on other sites

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.

Share this post


Link to post
Share on other sites

Hello Greg,

 

I believe the example in the latest version of the ZAP IDE for a Wishbone peripheral is sync.

 

Jack.

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now