Changeset 255 for soft/giet_vm/libs


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)
Location:
soft/giet_vm/libs
Files:
3 edited

Legend:

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

    r244 r255  
    3939            "sc   $3,    0($16)             \n" /* try to get lock */
    4040            "bnez $3,    giet_lock_ok       \n" /* exit if atomic */
     41            "nop                            \n"
    4142
    4243            "giet_lock_delay:               \n"
  • 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
  • soft/giet_vm/libs/stdio.h

    r253 r255  
    5050unsigned int giet_fb_cma_stop();
    5151
    52 /* Network controller relate functions */
     52/* Network controller related functions */
    5353unsigned int giet_nic_cma_rx_init(void* buf0, void* buf1, unsigned int length);
    5454unsigned int giet_nic_cma_tx_init(void* buf0, void* buf1, unsigned int length);
    5555unsigned int giet_nic_cma_stop();
     56
     57/* Simulation Helper related functions */
     58unsigned int giet_sc_stop();
     59unsigned int giet_end_simu(unsigned int retval);
     60unsigned int giet_throw_soclib_exception(unsigned int val);
     61unsigned int giet_pause_simu();
     62unsigned int giet_raise_sigint();
     63unsigned int giet_simhelper_cycles(unsigned int * retval);
    5664
    5765/* Misc */
Note: See TracChangeset for help on using the changeset viewer.