Ignore:
Timestamp:
Oct 9, 2013, 9:32:41 AM (11 years ago)
Author:
meunier
Message:
  • Added a syscall and some user functions to manipulate the Simulation Helper
  • Changed the the way the Vseg -> Pseg mapping is made during the boot to better utilize the address space (+ adaptation of the algorithm in memo)
  • Fixed a bug in boot_init (vobj_init): the vobj initialization could only be made for the first application (ptpr was not changed)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/libs/stdio.c

    r253 r255  
    4545#define SYSCALL_NIC_SYNC_READ     0x1E
    4646#define SYSCALL_NIC_SYNC_WRITE    0x1F
     47#define SYSCALL_SIM_HELPER_ACCESS 0x20
    4748
    4849//////////////////////////////////////////////////////////////////////////////////
     
    851852
    852853
     854////////////////////////////////////////////////////////////////////////////////////
     855// giet_sc_stop()
     856// This function causes the Sim Helper to cause sc_stop()
     857////////////////////////////////////////////////////////////////////////////////////
     858unsigned int giet_sc_stop()
     859{
     860    unsigned int reg_index = 0; // Index of the SIMHELPER_SC_STOP register
     861    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0);
     862}
     863
     864
     865////////////////////////////////////////////////////////////////////////////////////
     866// giet_end_simu()
     867// This function causes the Sim Helper to cause exit(val)
     868////////////////////////////////////////////////////////////////////////////////////
     869unsigned int giet_end_simu(unsigned int val)
     870{
     871    unsigned int reg_index = 1; // Index of the SIMHELPER_END_WITH_RETVAL register
     872    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, val, 0, 0);
     873}
     874
     875
     876////////////////////////////////////////////////////////////////////////////////////
     877// giet_throw_soclib_exception()
     878// This function causes the Sim Helper to launch a soclib exception with val in message
     879////////////////////////////////////////////////////////////////////////////////////
     880unsigned int giet_throw_soclib_exception(unsigned int val)
     881{
     882    unsigned int reg_index = 2; // Index of the SIMHELPER_EXCEPT_WITH_VAL register
     883    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, val, 0, 0);
     884}
     885
     886
     887////////////////////////////////////////////////////////////////////////////////////
     888// giet_pause_simu()
     889// This function causes the Sim Helper to pause the simulation
     890////////////////////////////////////////////////////////////////////////////////////
     891unsigned int giet_pause_simu()
     892{
     893    unsigned int reg_index = 3; // Index of the SIMHELPER_PAUSE_SIM register
     894    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0);
     895}
     896
     897
     898////////////////////////////////////////////////////////////////////////////////////
     899// giet_raise_sigint()
     900// This function causes the Sim Helper to call raise(SIGINT) to interrupt simulation
     901////////////////////////////////////////////////////////////////////////////////////
     902unsigned int giet_raise_sigint()
     903{
     904    unsigned int reg_index = 5; // Index of the SIMHELPER_PAUSE_SIM register
     905    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, 0, 0);
     906}
     907
     908
     909////////////////////////////////////////////////////////////////////////////////////
     910// giet_simhelper_cycles()
     911// This function causes the Sim Helper to write the number of simulated cycles
     912// at address *retval
     913////////////////////////////////////////////////////////////////////////////////////
     914unsigned int giet_simhelper_cycles(unsigned int * retval)
     915{
     916    unsigned int reg_index = 4; // Index of the SIMHELPER_PAUSE_SIM register
     917    return sys_call(SYSCALL_SIM_HELPER_ACCESS, reg_index, 0, (unsigned int) retval, 0);
     918}
     919
     920
     921
    853922// Local Variables:
    854923// tab-width: 4
Note: See TracChangeset for help on using the changeset viewer.