Page 105 - Mechatronic Systems Modelling and Simulation with HDLs
P. 105

94                       5  SOFTWARE IN HARDWARE DESCRIPTION LANGUAGES


               range of initialisations are necessary, such as, for example, filling the memory with
               the programme, resetting the register and jumping to the first instruction.
                 If the C routine has been called before, the correct context must first of all
               be created. If it is a replay the old stored context is activated by exchanging
               (exchange_context) with the current context. Then the old context is always
               protected by copying (copy_context). The jumptothe hub brings about a jump
               to the instruction referred to in the programme counter of the current context.
                 The lda, jsr and bra instructions from the assembler programme can also be
               found in the C routine. There are called by labels (l256, l258, l261), which
               permit jumping to the instructions using the goto command.
                 First the lda should be considered more closely. Depending upon the targetted
               address this command fetches a value from the memory or from a port and stores
               it in the accumulator. First a routine is called up for this instruction, which controls
               the debugger and thus permits it to visualise the software sequence, indicate values,
               and control the software sequence by means of breakpoints. The user interface of
               the debugger is shown in Figure 5.7. The next instruction decides whether the











































                               Figure 5.7  Software debugger for virtual hardware
   100   101   102   103   104   105   106   107   108   109   110