Download GRSIM User`s Manual

Transcript
Cobham Gaisler AB
11
GRSIM User’s Manual
int (*AddParams)(int idx, char **params, char *str);
/* data */
char **params;
/* operations */
int (*init)(char *str);
int (*exit)(void);
int (*cmd) (char *cmd, void* arg);
int (*ctrl)(int ctl, void* arg);
int (*SetMBApbMaster)(void *simulator, int busid, int apbid);
int (*SetBusPnp)(void *simulator, int busid, unsigned int addr );
} SimConf_T;
where,
sim
is a pointer to the current simulator instance.
AddLib
is used to add a library to the built-in ones in grsim. This allows reuse of device
driver ID.
AddDriver
adds a driver to one of the existing libraries.
CreateBus
creates a bus in the system. The return value from this function is the busid of the
newly created bus. A bus must, of course, be created before any device is added to
the system.
AddDevice
adds a device to a bus in the simulated system. The first 6 parameters to AddDevice() are fixed. numbars designate the number of entries to follow. Each entry is
headed by a tag followed by variable arguments depending on the tag. The possible
tags are:
APB <start> <size> <iscache>
Add a APB slave memory bar to the last added APB master.
MASTER
Add a AHB master memory bar to the bus.
SLAVE <start> <size> <iscache>
Add a AHB slave memory bar to the bus.
AHBIO <start> <size> <iscache>
Add a AHB slave io bar to the bus.
In addition there are tags that are used when configuring a multibus system:
SWITCHBUS <busid>
Switch membar allocation target to bus with id <busid>. This is used
when configuring a device with multiple interfaces to different buses.
SETVERSION
Set the version field of all following entries. The default version is 0.
SETCUSTOM <idx> <val>
Set the custom0-2 membar entry.