aboutsummaryrefslogtreecommitdiff
path: root/sim
AgeCommit message (Collapse)AuthorFilesLines
2023-12-21sim: common: add $LINENO rewriting support to genmloop scriptsMike Frysinger4-22/+83
The generated mloop files can trigger compile time warnings. It can be difficult to see/understand where the original code is coming from as all the diagnostics point to the generated output. Using #line pragmas, we can point people to the original source files. Unfortunately, this code is written in POSIX shell, and that lacks support for line number tracking. The $LINENO variable, even when available, can just be plain wrong. For example, when using dash and subshells, $LINENO can end up having negative values. Add a wrapper script that will uses awk to rewrite the $LINENO variable to the right value to avoid all that. Basically lineno.sh takes an input script, rewrites all uses of $LINENO into the actual line number (and $0 into the original file name), and then executes the temporary script. This commit doesn't actually add #line pragmas to any files. That comes next.
2023-12-21sim: warnings: enable -Wimplicit-fallthrough=5Mike Frysinger2-0/+2
It caught some legitimate bugs, so clearly it's helpful.
2023-12-21sim: sh: fix -Wimplicit-fallthrough warningsMike Frysinger1-0/+1
These generate conditional insns where it tests, then fallsthru.
2023-12-21sim: rx: fix -Wimplicit-fallthrough warningsMike Frysinger1-2/+2
Replace some fall through comments with the attribute.
2023-12-21sim: rl78: fix -Wimplicit-fallthrough warningsMike Frysinger1-0/+1
Seems like this code was meant to fallthru.
2023-12-21sim: riscv: fix -Wimplicit-fallthrough warningsMike Frysinger1-0/+1
2023-12-21sim: ppc: fix -Wimplicit-fallthrough warningsMike Frysinger1-1/+1
Replace some fall through comments with the attribute.
2023-12-21sim: or1k: fix -Wimplicit-fallthrough warningsMike Frysinger1-1/+1
Replace some fall through comments with the attribute.
2023-12-21sim: mips: fix -Wimplicit-fallthrough warningsMike Frysinger3-1/+13
Seems like these cases were meant to fallthru.
2023-12-21sim: mcore: fix Wimplicit-fallthrough warningsMike Frysinger1-0/+2
Seems like these decodes were intended to fallthru.
2023-12-21sim: m68hc11: fix -Wimplicit-fallthrough warningsMike Frysinger2-0/+2
Seems like these register operations intended on falling thru.
2023-12-21sim: frv: fix -Wimplicit-fallthrough warningsMike Frysinger2-3/+3
Replace some fall through comments with the attribute.
2023-12-21sim: erc32: fix -Wimplicit-fallthrough warningsMike Frysinger3-0/+12
Add the attribute where it seems to make sense.
2023-12-21sim: cris: fix -Wimplicit-fallthrough warningsMike Frysinger2-1/+5
Replace some fall through comments with the attribute.
2023-12-21sim: bfin: fix -Wimplicit-fallthrough warningsMike Frysinger4-0/+5
Add the attribute to places where we want to fall thru.
2023-12-21sim: avr: fix -Wimplicit-fallthrough warningsMike Frysinger1-1/+1
Replace some fall through comments with the attribute.
2023-12-21sim: arm: fix -Wimplicit-fallthrough warningsMike Frysinger4-8/+10
Replace some fall through comments with the attribute.
2023-12-21sim: aarch64: fix -Wimplicit-fallthrough warningsMike Frysinger1-14/+26
Replace some fall through comments with the attribute, and add some default abort calls when the compiler can't figure out that the set of values were already fully enumerated in the switch statement.
2023-12-21sim: common: fix -Wimplicit-fallthrough warningsMike Frysinger3-5/+7
Replace some fall through comments with the attribute.
2023-12-21sim: add ATTRIBUTE_FALLTHROUGH for local codeMike Frysinger2-0/+6
We'll replace various /* fall through */ comments so compilers can actually understand what the code is doing.
2023-12-21sim: signal: mark signal callback funcs as noreturn since they don't returnMike Frysinger11-11/+15
All funcs already call other funcs that don't return. The mips port is the only exception because its generic exception handler can return in the case of normal exceptions. So while the exceptions its signal handler triggers doesn't return, we can't express that conditional logic. So add some useless abort calls to make the compiler happy.
2023-12-21sim: sh: add missing breaks to bit processingMike Frysinger1-0/+6
Doesn't seem like we want to cascade in this section when bit processing.
2023-12-21sim: rx: mark abort func as noreturn since it doesn'tMike Frysinger1-1/+1
2023-12-21sim: rx: add missing break to memory writeMike Frysinger1-0/+1
It doesn't seem like we want to keep executing the next block of code after processing the request.
2023-12-21sim: iq2000: add fallback for exit syscallMike Frysinger1-0/+3
Make sure this syscall always exits regardless of the exit code.
2023-12-21sim: cr16: add missing break statementMike Frysinger1-0/+1
Doesn't seem to make sense for this to fall through (although I'm not an expert in this ISA).
2023-12-21sim: arm: add missing breaks to SWI processingMike Frysinger1-0/+2
Seems unlikely we want the remove syscall to fallthrough into the rename syscall since we can't rename files that have been removed.
2023-12-21sim: common: mark engine restart as noreturnMike Frysinger1-1/+1
This helps the compiler with optimization and fixes fallthru warnings.
2023-12-21sim: ppc: phb: add missing break to address decoderMike Frysinger1-0/+1
I don't know what this emulation does exactly, but it missing a break statement seems kind of obvious based on the 32-bit case above it.
2023-12-21sim: ppc: mark halt & restart funcs as noreturnMike Frysinger3-6/+6
This helps the compiler with optimization and fixes fallthru warnings.
2023-12-21sim: warnings: enable -Wduplicated-condMike Frysinger2-0/+2
2023-12-21sim: mn10300: fix LAST_TIMER_REG typoMike Frysinger1-1/+1
The compiler pointed out that we're testing LAST_TIMER_REG and LAST_COUNTER which are the same value ... and that's because we set LAST_TIMER_REG to the wrong register. Fix the typo.
2023-12-21sim: bfin: clean up astat reg name decode a littleMike Frysinger1-12/+14
The compiler pointed out we checked AZ twice. Sort by name to avoid that in the future, and to make it clearer that we have coverage of all the bits. And add the bits we were missing. The order here doesn't matter as it's just turning a pointer into a human readable string when store tracing is enabled.
2023-12-20sim: common: delete unused scache in some mloop pathsMike Frysinger1-4/+0
The scache vars aren't used by ports in the pbb & fast codepaths, nor are they documented as inputs to the callbacks, so delete them to avoid unused variable compiler warnings.
2023-12-20sim: cgen: unify the genmloop logic a bitMike Frysinger8-72/+64
Pull out the common parts of the genmloop invocation into the common code. This will make it easier to add more, and make the per-port differences a little more obvious.
2023-12-19sim: frv: enable warnings in memory.cMike Frysinger3-3/+1
Fix one minor pointer-sign warning to enable warnings in general for this file. Reading the data as signed and then returning it as unsigned should be functionally the same in this case.
2023-12-19sim: common: delete unused argbuf in generated mloop codeMike Frysinger1-2/+0
This function only uses prev_abuf, not abuf, and doesn't inline code from the various ports on the fly, so abuf will never be used.
2023-12-19sim: v850: fix -Wunused-variable warningsMike Frysinger1-1/+0
2023-12-19sim: sh: fix -Wunused-variable warningsMike Frysinger1-3/+1
2023-12-19sim: moxie: fix -Wunused-variable warningsMike Frysinger1-8/+1
2023-12-19sim: msp430: fix -Wunused-variable warningsMike Frysinger1-5/+2
2023-12-19sim: mn10300: fix -Wunused-variable warningsMike Frysinger2-9/+0
2023-12-19sim: mips: fix -Wunused-variable warningsMike Frysinger5-21/+12
2023-12-19sim: microblaze: fix -Wunused-variable warningsMike Frysinger1-6/+0
2023-12-19sim: mcore: fix -Wunused-variable warningsMike Frysinger1-4/+3
2023-12-19sim: m32r: fix -Wunused-variable warningsMike Frysinger1-2/+0
2023-12-19sim: lm32: fix -Wunused-variable warningsMike Frysinger4-15/+1
2023-12-19sim: iq2000: fix -Wunused-variable warningsMike Frysinger2-2/+0
2023-12-19sim: h8300: fix -Wunused-variable warningsMike Frysinger1-7/+0
2023-12-19sim: ft32: fix -Wunused-variable warningsMike Frysinger1-6/+0