This repository has been archived by the owner on Apr 13, 2019. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SiFive CLIC (Core Level Interrupt Controller) test-beta1 #157
base: qemu-for-upstream
Are you sure you want to change the base?
SiFive CLIC (Core Level Interrupt Controller) test-beta1 #157
Changes from 1 commit
59a2a1167110fb458d08e0461550dabcc50970b95be0bc5820bf571631aa0b45fe21a8373796024ece650a656f3b379f5ac2901ddf4399d2ad210008812433bea8bb0764aa94fc5d8822ad9b10eec015ae8ae79ce8b594425571edfc4d86d34f99029d4473b63384163e2027727016afc7b1e00884c7010a132670b22435d7e5d78577f7aacf5f50f63801b3206d9acFile filter
Filter by extension
Conversations
Jump to
- Implements draft clic-spec (20180728) - Implements non-vectored mode and vectored mode - Implements mode+level+priority configuration - Implements mode+level+priority preemption model - Seperated M-mode (mtvec) and S-mode (stvec) delivery - CLIC supports backwards compatible CLINT mode for legacy interrupts using MIE/MIP,SIE/SIP (irq < 16) depending on mtvec (MTI,MSI) and stvec (STI,SSI) - CLINT mode supports S-mode stimecmp{h} and ssip{h} - QEMU CLINT/CLIC Test Cases - https://github.com/michaeljclark/qemu-riscv-tests - Adds two experimental machines - SiFive Freedom E-Series with CLIC - Implements M-mode CLINT/CLIC config memory map - Parameters - CLICINTBITS=4 - CLICCFGMBITS=0 - CLICCFGLBITS=4 - Invocation - qemu-system-riscv{32,64} -machine sifive_ex - SiFive Freedom U-Series with CLIC - Implements M-mode and S-mode CLINT/CLIC memory map - Parameters - CLICINTBITS=8 - CLICCFGMBITS=2 - CLICCFGLBITS=4 - Invocation - qemu-system-riscv{32,64} -machine sifive_ux - CLIC combined CLINT/CLIC memory map - M-Mode CLINT = 0x02000000 - msip = 0x02000000 + hartid * 4 - mtimecmp = 0x02004000 + hartid * 4 - mtime = 0x0200bff8 - S-Mode CLINT = 0x02020000 - M-mode CLIC = 0x02080000 - clicintip = 0x02080000 + hartid * 0x1000 + 0x000 - clicintie = 0x02080000 + hartid * 0x1000 + 0x400 - clicintcfg = 0x02080000 + hartid * 0x1000 + 0x800 - cliccfg = 0x02080000 + hartid * 0x1000 + 0xc00 - S-Mode CLIC = 0x020c0000 - clicintip = 0x020c0000 + hartid * 0x1000 + 0x000 - clicintie = 0x020c0000 + hartid * 0x1000 + 0x400 - clicintcfg = 0x020c0000 + hartid * 0x1000 + 0x800 - Adds CLIC interrupt tracing (`-d trace:riscv_trap,...`) - riscv_trap # existing core interrupt tracing - sifive_clic_cfg # CLIC global configuration - sifive_clic_intcfg # CLIC interrupt configuration - sifive_clic_intie # CliC interrupt enable - sifive_clic_intip # CLIC interrupt pending - sifive_clic_irq # CLIC irq entry - Notes / Limitations - Enforces clicintcfg writes based on cliccfg and mode - Reads/writes to intcfg/intie/intip in lower mode MMIO apetures are currently allowed. Access checks need to be added to suppress writes and hardwire read reults to zero for any entries that where mode < clicintcfg.mode - Interrupts pending bits are writable by software. Edge/Level configuration needs to be added to control software access to interrupt pending bits - Selective vectoring in non-vectored mode is unimplemented - PLIC is currently not routed via the CLIC however pending bits can be written by software to test pre-emption. - mnxti/snxti sets mstatus flags but returns 0 (slow path). The CLIC state is currenetly not accessible from target/riscv as cpu implementations can't include anything from include/hw so the CLIC state needs to be in a CPU accessible structure. - Potential race condition if an interrupt is posted before the CPU has received and processed an outstanding interrupt due to env->exccode being overwritten. Needs changes to the interface from the CLIC so that the CPU interrupt handler pulls the highest priority interrupt from the CLIC at the time it is woken up. This requires the CLIC state to be accessible from the CPU similarly to mnxti - CPU core changes are relatively intrusive. The CPU interrupt handling requires some abstraction/hooks for a more modular CLIC implementation. CLIC state needs to be attached to the CPU, and accessible to the MMIO device with hooks in riscv_cpu_exec_interrupt and riscv_cpu_do_interrupt Changes since v0 - Fix array index calculation in sifive_clic_realize - Raise CLIC_LEVEL_BITS to 8 and fix assertion - Move CLIC parameterization constants to its headerThere are no files selected for viewing