| Version 8 (modified by , 19 years ago) (diff) |
|---|
SrlApi
Srl API is your gateway to the system resources.
Logging
Log API let you define message levels. Levels allow you to let your debug code in the source, and only compile it when needed.
In order, levels are:
- NONE
- TRACE
- DEBUG
- MAX
When writing your software, you decide what level the message is for. When compiling or running you software, you decide what minimal level your code must have to be printed.
srl_log(level, "message")prints a messagesrl_log_printf(level, "message_with_format", arguments...)prints a printf-like message
Arguments in printf-like version may be not evaluated if level is not sufficient. Therefore you MUST NOT put expressions with side effects in the parameter list. ie do not do this:
srl_log_printf(DEBUG, "i=%d\n", i++);
Mwmr Communication Channels
srl_mwmr_t channel = GET_ARG(port_name)defines a local variable associated to a MWMR channel acces port. Theport_nameargument corresponds to the port name defined in the task model defined in the DSX description.
srl_mwmr_read(channel, local_buffer, size)readssize32-bit words from the MWMR channel to the local buffer. Thelocal_bufferargument is avoid*. Thesizeargument must be a multiple of the channel width.
srl_mwmr_write(channel, local_buffer, size)writessize32-bit words from the local buffer to the MWMR channel. Thelocal_bufferargument is avoid*. Thesizeargument must be a multiple of the channel width.
Locks
srl_lock_lock( lock )takes a lock, waiting if necessarysrl_lock_unlock( lock )releases the lock
Barriers
srl_barrier_wait( barrier )waits for a barrier-global synchronization
Other APIs
srl_busy_cycles( N )tells the simulation environment the simulation should run at least N cycles while in this call. This makes sense only for virtually synthetised tasks, otherwise, this call is a noop.srl_mwmr_config( controller_name, reg_n, value )puts valuevaluein config registerreg_nof specified controllersrl_mwmr_status( controller_name, reg_n )reads status registerreg_nof specified controller, returns a int32_tsrl_assert( cond )checkscondis true, fatally fails otherwise
