Hmm, FPGA world ok, convincedFolknology wrote:or ADC(channel=2) :> sample
But what if the answer is a bit more complicated (e.g. has a timestamp):
ADC(channel=2):> message
if (message.timestamp .... do something
??But I wouldn't actually do it this way because its not structuredCode: Select all
ADC[2] :> sample; if(sample.ts == somecondition) do something;
Not sure why you would branch on the sample timestamp?
regards
Al
Yes the use case is for illustration purpose only. I do not think switching on a time stamp makes any sense. But you are right.Folknology wrote:A more structured example might be example:Code: Select all
select { case ADC[2] :> sample : { switch(sample.ts) { case TS1 : do ts1 thing; case TS2 : do ts2 thing; default : do default thing; } } }
And perhaps you have already given the answer to one of my questions:
Messages are structs - or at least the body of the message. This could give quite an easy way to specify protocols.
Message IDs are 'methods'. OK
So we got services/modules and module contracts (e.g. by message numbers and expected/provided structs).
What is still missing is implementing and reuse of contracts - and this gives quite a complicated control structure - lots of switch/case implementations.
Will go back with the new knowledge and think about it.
Two thinkgs still puzzle me:
- Understood that XMOS is much more FPGA like than MCU like. Nevertheless it can be an MCU. Perhaps there is some layering model. Lower layers are FPGA layers, higher layers can be more MCU-like layers. Do those MCU layers exist? OR is it just me?
- Objective C (or C++) CAN be an implementation language for those layers but is not really needed. To make it real flexible and easy an better XC version with defined modules, private variables and protocols can be better. But what buildung blocks do we need there (modules/services, private data, instance data(?), contracts, flexible interpretation of contracts(?).
Will keep that in my mind and think about it while I am implementing my stuff .
Thanks for the clarification so far. Understood a lot!