Line 122... |
Line 122... |
|
|
/* CPU */
|
/* CPU */
|
config.cpu.superscalar = 0;
|
config.cpu.superscalar = 0;
|
config.sim.history = 0;
|
config.sim.history = 0;
|
config.cpu.hazards = 0;
|
config.cpu.hazards = 0;
|
|
config.cpu.raw_range = 0;
|
config.cpu.dependstats = 0;
|
config.cpu.dependstats = 0;
|
config.cpu.sbuf_len = 0;
|
config.cpu.sbuf_len = 0;
|
config.cpu.upr = SPR_UPR_UP | SPR_UPR_DCP | SPR_UPR_ICP | SPR_UPR_DMP
|
config.cpu.upr = SPR_UPR_UP | SPR_UPR_DCP | SPR_UPR_ICP | SPR_UPR_DMP
|
| SPR_UPR_IMP | SPR_UPR_OB32P | SPR_UPR_DUP | SPR_UPR_PICP
|
| SPR_UPR_IMP | SPR_UPR_OB32P | SPR_UPR_DUP | SPR_UPR_PICP
|
| SPR_UPR_PMP | SPR_UPR_TTP;
|
| SPR_UPR_PMP | SPR_UPR_TTP;
|
Line 144... |
Line 145... |
config.nethernets = 0;
|
config.nethernets = 0;
|
|
|
/* GPIO */
|
/* GPIO */
|
config.ngpios = 0;
|
config.ngpios = 0;
|
|
|
|
/* Tick timer */
|
|
config.tick.enabled = 0;
|
|
|
/* PM */
|
/* PM */
|
config.pm.enabled = 0;
|
config.pm.enabled = 0;
|
#endif
|
#endif
|
|
|
/* Configure runtime */
|
/* Configure runtime */
|
Line 386... |
Line 390... |
void memory_name ();
|
void memory_name ();
|
void memory_log ();
|
void memory_log ();
|
void memory_delayr ();
|
void memory_delayr ();
|
void memory_delayw ();
|
void memory_delayw ();
|
void cpu_sbuf_len ();
|
void cpu_sbuf_len ();
|
|
void cpu_raw_range ();
|
void eth_nethernets ();
|
void eth_nethernets ();
|
void eth_baseaddr ();
|
void eth_baseaddr ();
|
void eth_irq ();
|
void eth_irq ();
|
void eth_dma ();
|
void eth_dma ();
|
void eth_rtx_type ();
|
void eth_rtx_type ();
|
Line 452... |
Line 457... |
{"cpu", 0}, /* 5 */
|
{"cpu", 0}, /* 5 */
|
{"sim", 0},
|
{"sim", 0},
|
{"debug", 0},
|
{"debug", 0},
|
{"VAPI", 0},
|
{"VAPI", 0},
|
{"ethernet",0},
|
{"ethernet",0},
|
{"", 0}, /* 10 */
|
{"tick", 0}, /* 10 */
|
{"immu", 0},
|
{"immu", 0},
|
{"dmmu", 0},
|
{"dmmu", 0},
|
{"ic", 0},
|
{"ic", 0},
|
{"dc", 0},
|
{"dc", 0},
|
{"gpio", 0}, /* 15 */
|
{"gpio", 0}, /* 15 */
|
Line 520... |
Line 525... |
{5, "rev", "=0x%x", NULL, (void *)(&config.cpu.rev), 0},
|
{5, "rev", "=0x%x", NULL, (void *)(&config.cpu.rev), 0},
|
{5, "upr", "=0x%x", NULL, (void *)(&config.cpu.upr), 0},
|
{5, "upr", "=0x%x", NULL, (void *)(&config.cpu.upr), 0},
|
{5, "sr", "=0x%x", NULL, (void *)(&config.cpu.sr), 0},
|
{5, "sr", "=0x%x", NULL, (void *)(&config.cpu.sr), 0},
|
{5, "hazards", "=%i", NULL, (void *)(&config.cpu.hazards), 0},
|
{5, "hazards", "=%i", NULL, (void *)(&config.cpu.hazards), 0},
|
{5, "superscalar", "=%i", NULL, (void *)(&config.cpu.superscalar), 0},
|
{5, "superscalar", "=%i", NULL, (void *)(&config.cpu.superscalar), 0},
|
|
{5, "raw_range", "=%i", cpu_raw_range, (void *)(&config.cpu.raw_range), 0},
|
{5, "dependstats", "=%i", NULL, (void *)(&config.cpu.dependstats), 0},
|
{5, "dependstats", "=%i", NULL, (void *)(&config.cpu.dependstats), 0},
|
{5, "sbuf_len", "=%i", cpu_sbuf_len, (void *)(&config.cpu.sbuf_len), 0},
|
{5, "sbuf_len", "=%i", cpu_sbuf_len, (void *)(&config.cpu.sbuf_len), 0},
|
|
|
{6, "debug", "=%i", NULL, (void *)(&config.sim.debug), 0},
|
{6, "debug", "=%i", NULL, (void *)(&config.sim.debug), 0},
|
{6, "verbose", "=%i", NULL, (void *)(&config.sim.verbose), 0},
|
{6, "verbose", "=%i", NULL, (void *)(&config.sim.verbose), 0},
|
Line 565... |
Line 571... |
{9, "rxfile", "=\"%s\"", eth_rxfile, (void *)(&tempS[0]), 0},
|
{9, "rxfile", "=\"%s\"", eth_rxfile, (void *)(&tempS[0]), 0},
|
{9, "txfile", "=\"%s\"", eth_txfile, (void *)(&tempS[0]), 0},
|
{9, "txfile", "=\"%s\"", eth_txfile, (void *)(&tempS[0]), 0},
|
{9, "sockif", "=\"%s\"", eth_sockif, (void *)(&tempS[0]), 0},
|
{9, "sockif", "=\"%s\"", eth_sockif, (void *)(&tempS[0]), 0},
|
{9, "vapi_id", "=0x%x", eth_vapi_id, (void *)(&tempUL), 0},
|
{9, "vapi_id", "=0x%x", eth_vapi_id, (void *)(&tempUL), 0},
|
|
|
|
{10, "enabled", "=%i", NULL, (void *)(&config.tick.enabled), 0},
|
|
|
{11, "enabled", "=%i", immu_enabled, (void *)(&tempL), 0},
|
{11, "enabled", "=%i", immu_enabled, (void *)(&tempL), 0},
|
{11, "nsets", "=%i", immu_nsets, (void *)(&tempL), 0},
|
{11, "nsets", "=%i", immu_nsets, (void *)(&tempL), 0},
|
{11, "nways", "=%i", immu_nways, (void *)(&tempL), 0},
|
{11, "nways", "=%i", immu_nways, (void *)(&tempL), 0},
|
{11, "pagesize", "=%i", immu_pagesize, (void *)(&tempL), 0},
|
{11, "pagesize", "=%i", immu_pagesize, (void *)(&tempL), 0},
|
{11, "entrysize", "=%i", immu_entrysize,(void *)(&tempL), 0},
|
{11, "entrysize", "=%i", immu_entrysize,(void *)(&tempL), 0},
|
Line 846... |
Line 854... |
config.memory.table[current_device].delayw = tempL;
|
config.memory.table[current_device].delayw = tempL;
|
else
|
else
|
ERROR("invalid device number.");
|
ERROR("invalid device number.");
|
}
|
}
|
|
|
|
void cpu_raw_range () {
|
|
if (config.cpu.raw_range >= RAW_RANGE) {
|
|
config.cpu.raw_range = RAW_RANGE - 1;
|
|
WARNING("raw range too large; truncated.");
|
|
} else if (config.cpu.raw_range < 0) {
|
|
config.cpu.raw_range = 0;
|
|
WARNING("raw range negative; disabled.");
|
|
}
|
|
}
|
|
|
void cpu_sbuf_len () {
|
void cpu_sbuf_len () {
|
if (config.cpu.sbuf_len >= MAX_SBUF_LEN) {
|
if (config.cpu.sbuf_len >= MAX_SBUF_LEN) {
|
config.cpu.sbuf_len = MAX_SBUF_LEN - 1;
|
config.cpu.sbuf_len = MAX_SBUF_LEN - 1;
|
WARNING("sbuf_len too large; truncated.");
|
WARNING("sbuf_len too large; truncated.");
|
} else if (config.cpu.sbuf_len < 0) {
|
} else if (config.cpu.sbuf_len < 0) {
|
Line 1343... |
Line 1361... |
int i, comma;
|
int i, comma;
|
fprintf (f, "/* This file was automatically generated by or1ksim,\n"
|
fprintf (f, "/* This file was automatically generated by or1ksim,\n"
|
" using --output-cfg switch (cfg file '%s'). */\n"
|
" using --output-cfg switch (cfg file '%s'). */\n"
|
"const static struct config config = {\n", runtime.sim.script_fn);
|
"const static struct config config = {\n", runtime.sim.script_fn);
|
|
|
|
fprintf (f, " tick:{enabled:%i},\n", config.tick.enabled);
|
fprintf (f, " nuarts:%i, uarts:{", config.nuarts);
|
fprintf (f, " nuarts:%i, uarts:{", config.nuarts);
|
comma = 0;
|
comma = 0;
|
for (i = 0; i < config.nuarts; i++) {
|
for (i = 0; i < config.nuarts; i++) {
|
fprintf (f, "%s\n {rxfile:\"%s\", txfile:\"%s\", jitter:%i, baseaddr:0x%08x, irq:%i, vapi_id:0x%08x, uart16550:%i}",
|
fprintf (f, "%s\n {rxfile:\"%s\", txfile:\"%s\", jitter:%i, baseaddr:0x%08x, irq:%i, vapi_id:0x%08x, uart16550:%i}",
|
comma ? "," :"", config.uarts[i].rxfile, config.uarts[i].txfile, config.uarts[i].jitter, config.uarts[i].baseaddr, config.uarts[i].irq,
|
comma ? "," :"", config.uarts[i].rxfile, config.uarts[i].txfile, config.uarts[i].jitter, config.uarts[i].baseaddr, config.uarts[i].irq,
|
Line 1414... |
Line 1433... |
|
|
fprintf (f, " bpb:{enabled:%i, sbp_bnf_fwd:%i, sbp_bf_fwd:%i, btic:%i, missdelay:%i, hitdelay:%i},\n",
|
fprintf (f, " bpb:{enabled:%i, sbp_bnf_fwd:%i, sbp_bf_fwd:%i, btic:%i, missdelay:%i, hitdelay:%i},\n",
|
config.bpb.enabled, config.bpb.sbp_bnf_fwd, config.bpb.sbp_bf_fwd, config.bpb.btic, config.bpb.missdelay, config.bpb.hitdelay);
|
config.bpb.enabled, config.bpb.sbp_bnf_fwd, config.bpb.sbp_bf_fwd, config.bpb.btic, config.bpb.missdelay, config.bpb.hitdelay);
|
|
|
fprintf (f, " cpu:{upr:0x%08x, ver:0x%04x, rev:0x%04x, superscalar:%i, hazards:%i, dependstats:%i,\n"
|
fprintf (f, " cpu:{upr:0x%08x, ver:0x%04x, rev:0x%04x, superscalar:%i, hazards:%i, dependstats:%i,\n"
|
" sr:0x%08x},\n",
|
" raw_range:%i, sr:0x%08x},\n",
|
config.cpu.upr, config.cpu.ver, config.cpu.rev, config.cpu.superscalar, config.cpu.hazards, config.cpu.dependstats,
|
config.cpu.upr, config.cpu.ver, config.cpu.rev, config.cpu.superscalar, config.cpu.hazards, config.cpu.dependstats,
|
config.cpu.sr);
|
config.cpu.raw_range, config.cpu.sr);
|
|
|
fprintf (f, " sim:{debug:%i, verbose:%i, profile:%i, prof_fn:\"%s\", mprofile:%i, mprof_fn:\"%s\",\n",
|
fprintf (f, " sim:{debug:%i, verbose:%i, profile:%i, prof_fn:\"%s\", mprofile:%i, mprof_fn:\"%s\",\n",
|
config.sim.debug, config.sim.verbose, config.sim.profile, config.sim.prof_fn, config.sim.mprofile, config.sim.mprof_fn);
|
config.sim.debug, config.sim.verbose, config.sim.profile, config.sim.prof_fn, config.sim.mprofile, config.sim.mprof_fn);
|
|
|
fprintf (f, " history:%i, exe_log:%i, exe_log_fn:\"%s\", clkcycle_ps:%i,\n",
|
fprintf (f, " history:%i, exe_log:%i, exe_log_fn:\"%s\", clkcycle_ps:%i,\n",
|