12-16-2009 06:25 PM
03-11-2011 03:55 PM
Göran (e du svensk?),
I'm confused about your answer here. It was my understanding that cputfsl(val, id) would put the value in "val" into the control bit. Otherwise how would cgetfsl work to get the control bit? That is, in order to write a value onto the data bus, and set the control bit you would have to:
When you called putfsl it would write the entire thing with the control bit and data. Is that not accurate? If I assumed that cputfsl wrote "val" to the data bus and a 1 to the control bit in one instruction, then how do I get a data value from the bus along with the control bit? How do I read the control bit for a particular data value? Can you provide a quick example? Thanks!
03-13-2011 12:51 AM
(Jo, Jag är svensk)
cput sets control bit to '1' and put sets control bit to '0'.
get doesn't "read" the control bit but you will see on the carry-bit if the control bit was not the expected value.
So cgetfsl assumes that control bit is '1' and will set the carry-bit in the MSR if it's not.
The same goes for getfsl which assumes than control bit is '0'.
You can read about this in the microblaze reference guide.
03-14-2011 08:58 AM
OK I get it. So in a situation (like mine) where we're using the control bit to indicate that the data is an address vs. data, I would call iserror after calling getfsl. If the control bit was a one, then I should get an error. If isinvalid is true, then there wasn't any data (fifo was empty, i'm using nonblocking). LIkewise when I want to write back using this method, I use cputfsl to write the address, putfsl to write data, and isinvalid to determine that the last write didn't work because the fifo is full.
Is this correct?
Thanks a million for your help, we're in the middle of the "freaking out" phase of our project. :)