One of the things I still need to implement is the "select" statement. The problem there is that the exact select statement (number of cases, etc..) is not known at compile time.
So I need to make some "dynamic select". I'm not sure what's the best way to do that properly.
- Peek seems to be for ports only, so that's a no-go.
- Make some function containing a select.
Something like the one below and call it for every case in the (Scheme) select:However, this code does not guarantee the CSP fairness rule :(.Code: Select all
int xc_select(chanend c, int value) { select { case c :> value: return 1; } return 0; }
How does the hardware guarantees the fairness (as I want to stay as close as possible to the HW) and is there some way to use the hardware functionality? - Other suggestions are welcome too ;)