[05/40] cpu/cris: Add u-stall virtual unit to CRIS v32

Message ID 24baefe92148f4b7968115ba13de9b0c863a65f6.1666257885.git.research_trasio@irq.a4lg.com
State Accepted
Headers
Series sim+gdb: Suppress warnings if built with Clang (big batch 1) |

Checks

Context Check Description
snail/binutils-gdb-check success Github commit url

Commit Message

Tsukasa OI Oct. 20, 2022, 9:25 a.m. UTC
  Because CRIS v32 model does not define u-stall virtual unit, CGEN-generated
sim/cris/decodev32.h does not define the function declaration of
crisv32f_model_crisv32_u_stall.

It led to a hack in commit 4e6e8ba7c565 ("sim: cris: clean up missing func
prototype warnings"), manually adding the declaration of
crisv32f_model_crisv32_u_stall.

To **not** touch CGEN-generated files manually, this commit adds u-stall
virtual unit for CRIS v32 to let CGEN generate the function declaration of
crisv32f_model_crisv32_u_stall automatically.

This is still hackish but less than the previous one.

cpu/ChangeLog:

	* cris.cpu: Add u-stall virtual unit to CRIS v32.
---
 cpu/cris.cpu | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Hans-Peter Nilsson Oct. 22, 2022, 1:44 a.m. UTC | #1
On Thu, 20 Oct 2022, Tsukasa OI via Binutils wrote:

> Because CRIS v32 model does not define u-stall virtual unit, CGEN-generated
> sim/cris/decodev32.h does not define the function declaration of
> crisv32f_model_crisv32_u_stall.
> 
> It led to a hack in commit 4e6e8ba7c565 ("sim: cris: clean up missing func
> prototype warnings"), manually adding the declaration of
> crisv32f_model_crisv32_u_stall.
> 
> To **not** touch CGEN-generated files manually, this commit adds u-stall
> virtual unit for CRIS v32 to let CGEN generate the function declaration of
> crisv32f_model_crisv32_u_stall automatically.
> 
> This is still hackish but less than the previous one.

Why "hackish"?  You mean cgen should not hork on not 
all models defining all the same units even if unused?

> cpu/ChangeLog:
> 
> 	* cris.cpu: Add u-stall virtual unit to CRIS v32.

Ok, thanks, with or without a comment above it saying "This unit 
is not used in CRIS v32 but needs to be defined for CGEN".

brgds, H-P
  

Patch

diff --git a/cpu/cris.cpu b/cpu/cris.cpu
index cd85f4e94e2..a2d054f954c 100644
--- a/cpu/cris.cpu
+++ b/cpu/cris.cpu
@@ -284,6 +284,7 @@ 
   (unit u-const16 "Fetch 16-bit operand" () 1 1 () () () ())
   (unit u-const32 "Fetch 32-bit operand" () 1 1 () () () ())
   (unit u-skip4 "Skip 4 bytes" () 1 1 () () () ())
+  (unit u-stall "Stall unit" () 1 1 () () () ())
 
   ; For v32, we need to keep track of inputs (for movem destination
   ; cycle penalties) and output (for e.g. memory source and jump