summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2022-10-26 08:00:42 +0200
committerJiri Gaisler <jiri@gaisler.se>2022-10-26 08:49:36 +0200
commit3229549f42030fd3eceeaaf0a054cf9328f252a1 (patch)
treef06d902534c0323ae3b0fb3c80575831924f264b
parentSupport extended interrupts (diff)
downloadsis-3229549f42030fd3eceeaaf0a054cf9328f252a1.tar.bz2
Add -extirq option to support simulating the UT700
-rw-r--r--gr740.c3
-rw-r--r--grlib.c7
-rw-r--r--grlib.h1
-rw-r--r--help.c3
-rw-r--r--leon3.c5
-rw-r--r--sis.c5
-rw-r--r--sis.h1
7 files changed, 18 insertions, 7 deletions
diff --git a/gr740.c b/gr740.c
index 7840ed2..75340de 100644
--- a/gr740.c
+++ b/gr740.c
@@ -56,7 +56,8 @@ init_sim (void)
{
int i;
- irqmp_extirq = 10;
+ if (irqmp_extirq < 0)
+ irqmp_extirq = 10;
for (i = 0; i < NCPU; i++)
grlib_ahbm_add (&leon3s, 0);
diff --git a/grlib.c b/grlib.c
index 1e03d26..c2d2acf 100644
--- a/grlib.c
+++ b/grlib.c
@@ -409,8 +409,11 @@ static uint32 irqmp_pextack[NCPU];
/* Mask with the supported interrupts */
static uint32 irqmp_mask;
-/* The extended interrupt line (a zero value disables the feature) */
-int irqmp_extirq;
+/*
+ * This is the extended interrupt line (a zero value disables the feature;
+ * if -1 use the default value of the CPU).
+ */
+int irqmp_extirq = -1;
static void
irqmp_init (void)
diff --git a/grlib.h b/grlib.h
index 036a93d..b182884 100644
--- a/grlib.h
+++ b/grlib.h
@@ -106,4 +106,3 @@ extern void apbuart_close_port (void);
extern void apbuart_flush (void);
extern const struct grlib_ipcore gptimer, irqmp, apbuart, apbmst,
greth, l2c, leon3s, srctrl, ns16550, clint, plic, sdctrl, s5test;
-extern int irqmp_extirq;
diff --git a/help.c b/help.c
index 4db2479..be7826f 100644
--- a/help.c
+++ b/help.c
@@ -26,9 +26,10 @@ sis_usage ()
printf ("usage: sis [-uart1 uart_device1] [-uart2 uart_device2]\n");
printf ("[-m <n>] [-dumbio] [-gdb] [-port port]\n");
+ printf ("[-nouartrx] [-extirq number]\n");
printf ("[-cov] [-nfp] [-ift] [-wrp] [-rom8] [-uben]\n");
printf ("[-freq frequency] [-c batch_file]\n");
- printf ("[-erc32] [-leon2] [-leon3] [-griscv] [-rv32]\n");
+ printf ("[-erc32] [-leon2] [-leon3] [-gr740] [-griscv] [-rv32]\n");
printf ("[-d] [-v] [-rt] [-bridge name] [files]\n");
}
diff --git a/leon3.c b/leon3.c
index 3a66d1e..d833689 100644
--- a/leon3.c
+++ b/leon3.c
@@ -56,8 +56,9 @@ init_sim (void)
{
int i;
- /* Use extended interrupt line of GR712RC */
- irqmp_extirq = 12;
+ /* Use extended interrupt line of GR712RC by default */
+ if (irqmp_extirq < 0)
+ irqmp_extirq = 12;
for (i = 0; i < ncpu; i++)
grlib_ahbm_add (&leon3s, 0);
diff --git a/sis.c b/sis.c
index 580eb64..cf59c71 100644
--- a/sis.c
+++ b/sis.c
@@ -147,6 +147,11 @@ main (argc, argv)
{
nouartrx = 1;
}
+ else if (strcmp (argv[stat], "-extirq") == 0)
+ {
+ if ((stat + 1) < argc)
+ irqmp_extirq = VAL (argv[++stat]);
+ }
else if (strcmp (argv[stat], "-r") == 0)
{
run = 1;
diff --git a/sis.h b/sis.h
index a357fb2..f60d9be 100644
--- a/sis.h
+++ b/sis.h
@@ -305,6 +305,7 @@ extern void sys_halt (void);
extern int elf_load (char *fname, int load);
extern double get_time (void);
extern int nouartrx;
+extern int irqmp_extirq;
//extern host_callback *sim_callback;
extern int dumbio;
extern int tty_setup;