Line 19... |
Line 19... |
|
|
#include <stdio.h>
|
#include <stdio.h>
|
|
|
/* Simulator configuration macros. Eventually this one will be a lot bigger. */
|
/* Simulator configuration macros. Eventually this one will be a lot bigger. */
|
|
|
#define NR_UARTS 4 /* Number of UARTs simulated */
|
#define MAX_UARTS 4 /* Max. number of UARTs simulated */
|
#define NR_DMAS 1 /* Number of DMA controllers */
|
#define MAX_DMAS 4 /* Max. number of DMA controllers */
|
#define NR_ETHERNETS 2 /* Number of Ethernet MACs */
|
#define MAX_ETHERNETS 4 /* Max. number of Ethernet MACs */
|
|
#define MAX_MEMORIES 16 /* Max. number of memory devices attached */
|
|
|
#define NONE 0
|
#define NONE 0
|
#define VIRTUAL 1
|
#define VIRTUAL 1
|
#define PHYSICAL 2
|
#define PHYSICAL 2
|
|
|
#define STR_SIZE (256)
|
#define STR_SIZE (256)
|
Line 54... |
Line 56... |
int jitter; /* CZ 250801 - in msecs...time to block */
|
int jitter; /* CZ 250801 - in msecs...time to block */
|
unsigned long baseaddr; /* Naturally aligned base address */
|
unsigned long baseaddr; /* Naturally aligned base address */
|
int irq; /* IRQ of this device */
|
int irq; /* IRQ of this device */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
int uart16550; /* Whether this device is uart 16450 or 16550 */
|
int uart16550; /* Whether this device is uart 16450 or 16550 */
|
} uarts[NR_UARTS];
|
} uarts[MAX_UARTS];
|
|
|
int ndmas;
|
int ndmas;
|
int dmas_enabled;
|
int dmas_enabled;
|
struct {
|
struct {
|
unsigned long baseaddr;
|
unsigned long baseaddr;
|
int irq; /* IRQ of this device */
|
int irq; /* IRQ of this device */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
} dmas[NR_DMAS];
|
} dmas[MAX_DMAS];
|
|
|
int nethernets;
|
int nethernets;
|
int ethernets_enabled;
|
int ethernets_enabled;
|
struct {
|
struct {
|
unsigned long baseaddr;
|
unsigned long baseaddr;
|
Line 74... |
Line 76... |
unsigned tx_channel; /* DMA channel used for TX */
|
unsigned tx_channel; /* DMA channel used for TX */
|
unsigned rx_channel; /* DMA channel used for RX */
|
unsigned rx_channel; /* DMA channel used for RX */
|
char rxfile[STR_SIZE]; /* Filename for RX */
|
char rxfile[STR_SIZE]; /* Filename for RX */
|
char txfile[STR_SIZE]; /* File for TX */
|
char txfile[STR_SIZE]; /* File for TX */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
unsigned long vapi_id; /* VAPI id for this instance */
|
} ethernets[NR_ETHERNETS];
|
} ethernets[MAX_ETHERNETS];
|
|
|
struct {
|
struct {
|
int enabled; /* is MC enabled? */
|
int enabled; /* is MC enabled? */
|
unsigned long baseaddr; /* Naturally aligned base address */
|
unsigned long baseaddr; /* Naturally aligned base address */
|
unsigned POC; /* power on reset configuration register */
|
unsigned POC; /* power on reset configuration register */
|
} mc;
|
} mc;
|
|
|
struct {
|
struct {
|
char memory_table_file[STR_SIZE]; /* Memory table filename */
|
|
int pattern; /* A user specified memory initialization pattern */
|
int pattern; /* A user specified memory initialization pattern */
|
int random_seed; /* Initialize the memory with random values, starting with seed */
|
int random_seed; /* Initialize the memory with random values, starting with seed */
|
enum {
|
enum {
|
MT_UNKNOWN,
|
MT_UNKNOWN,
|
MT_PATTERN,
|
MT_PATTERN,
|
MT_RANDOM
|
MT_RANDOM
|
} type;
|
} type;
|
|
int nmemories; /* Number of attached memories */
|
|
struct {
|
|
int ce; /* Which ce this memory is associated with */
|
|
unsigned long baseaddr; /* Start address of the memory */
|
|
unsigned long size; /* Memory size */
|
|
char name[STR_SIZE]; /* Memory type string */
|
|
char log[STR_SIZE]; /* Memory log filename */
|
|
int delayr; /* Read cycles */
|
|
int delayw; /* Write cycles */
|
|
} table[MAX_MEMORIES];
|
} memory;
|
} memory;
|
|
|
struct {
|
struct {
|
unsigned long upr; /* Unit present register */
|
unsigned long upr; /* Unit present register */
|
unsigned long ver, rev; /* Version register */
|
unsigned long ver, rev; /* Version register */
|
Line 141... |
Line 152... |
int init; /* Whether we are still initilizing sim */
|
int init; /* Whether we are still initilizing sim */
|
int script_file_specified;/* Whether script file was already loaded */
|
int script_file_specified;/* Whether script file was already loaded */
|
char *filename; /* Original Command Simulator file (CZ) */
|
char *filename; /* Original Command Simulator file (CZ) */
|
} sim;
|
} sim;
|
|
|
|
struct {
|
|
struct {
|
|
FILE *log; /* Log file for this device */
|
|
} table[MAX_MEMORIES];
|
|
} memory;
|
|
|
struct { /* Verification API, part of Advanced Core Verification */
|
struct { /* Verification API, part of Advanced Core Verification */
|
FILE *vapi_file; /* vapi file */
|
FILE *vapi_file; /* vapi file */
|
} vapi;
|
} vapi;
|
};
|
};
|
|
|