+ (name fr500)
+ (comment "FR500 cpu")
+ (cpu frvbf)
+)
+(define-model
+ (name fr500) (comment "FR500 model") (attrs)
+ (mach fr500)
+
+ (pipeline all "" () ((fetch) (decode) (execute) (writeback)))
+
+ ; `state' is a list of variables for recording model state
+ (state
+ ; State items
+ ; These are all masks with each bit representing one register.
+ (prev-fpop DI) ; Previous use of FR register was floating point insn
+ (prev-media DI) ; Previous use of FR register was a media insn
+ (prev-cc-complex DI) ; Previous use of ICC register was not simple
+ (cur-fpop DI) ; Current use of FR register was floating point insn
+ (cur-media DI) ; Current use of FR register was a media insn
+ (cur-cc-complex DI) ; Current use of ICC register was not simple
+ )
+ ; Basic unit for instructions with no latency penalties
+ (unit u-exec "Execution Unit" ()
+ 1 1 ; issue done
+ () ; state
+ () ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Basic integer insn unit
+ (unit u-integer "Integer Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Integer multiplication unit
+ (unit u-imul "Integer Multiplication Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((GRdoublek INT -1) (ICCi_1 INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Integer division unit
+ (unit u-idiv "Integer Division Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((GRk INT -1) (ICCi_1 INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Branch unit
+ (unit u-branch "Branch Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)
+ (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
+ ((pc)) ; outputs
+ () ; profile action (default)
+ )
+ ; Trap unit
+ (unit u-trap "Trap Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)
+ (ICCi_2 INT -1) (FCCi_2 INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Condition code check unit
+ (unit u-check "Check Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((ICCi_3 INT -1) (FCCi_3 INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Clrgr unit
+ (unit u-clrgr "Clrgr Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRk INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Clrfr unit
+ (unit u-clrfr "Clrfr Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRk INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; GR set half unit
+ (unit u-set-hilo "GR Set Half" ()
+ 1 1 ; issue done
+ () ; state
+ () ; inputs
+ ((GRkhi INT -1) (GRklo INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; GR load unit -- TODO doesn't handle quad
+ (unit u-gr-load "GR Load Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((GRk INT -1) (GRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; GR store unit -- TODO doesn't handle quad
+ (unit u-gr-store "GR Store Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; GR recovering store unit -- TODO doesn't handle quad
+ (unit u-gr-r-store "GR Recovering Store Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1) (GRk INT -1) (GRdoublek INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; FR load unit -- TODO doesn't handle quad
+ (unit u-fr-load "FR Load Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((FRintk INT -1) (FRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; FR store unit -- TODO doesn't handle quad
+ (unit u-fr-store "FR Store Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; FR recovering store unit -- TODO doesn't handle quad
+ (unit u-fr-r-store "FR Recovering Store Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Swap unit
+ (unit u-swap "Swap Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ ((GRk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; FR Move to FR unit
+ (unit u-fr2fr "FR Move to FR Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1)) ; inputs
+ ((FRk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; FR Move to GR unit
+ (unit u-fr2gr "FR Move to GR Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRintk INT -1)) ; inputs
+ ((GRj INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; SPR Move to GR unit
+ (unit u-spr2gr "SPR Move to GR Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((spr INT -1)) ; inputs
+ ((GRj INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; GR Move to FR unit
+ (unit u-gr2fr "GR Move to FR Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRj INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; GR Move to SPR unit
+ (unit u-gr2spr "GR Move to SPR Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRj INT -1)) ; inputs
+ ((spr INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Arithmetic unit
+ (unit u-float-arith "Float Arithmetic unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1) (FRj INT -1) ; inputs
+ (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
+ ((FRk INT -1) (FRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Dual Arithmetic unit
+ (unit u-float-dual-arith "Float Arithmetic unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1) (FRj INT -1) ; inputs
+ (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
+ ((FRk INT -1) (FRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Div unit
+ (unit u-float-div "Float Div unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1) (FRj INT -1)) ; inputs
+ ((FRk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Square Root unit
+ (unit u-float-sqrt "Float Square Root unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRj INT -1) (FRdoublej INT -1)) ; inputs
+ ((FRk INT -1) (FRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Dual Square Root unit
+ (unit u-float-dual-sqrt "Float Dual Square Root unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRj INT -1)) ; inputs
+ ((FRk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Compare unit
+ (unit u-float-compare "Float Compare unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1) (FRj INT -1)
+ (FRdoublei INT -1) (FRdoublej INT -1)) ; inputs
+ ((FCCi_2 INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Dual Float Compare unit
+ (unit u-float-dual-compare "Float Dual Compare unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRi INT -1) (FRj INT -1)) ; inputs
+ ((FCCi_2 INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Float Conversion unit
+ (unit u-float-convert "Float Conversion unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRj INT -1) (FRintj INT -1) (FRdoublej INT -1)) ; inputs
+ ((FRk INT -1) (FRintk INT -1) (FRdoublek INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Dual Float Conversion unit
+ (unit u-float-dual-convert "Float Dual Conversion unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRj INT -1) (FRintj INT -1)) ; inputs
+ ((FRk INT -1) (FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media unit
+ (unit u-media "Media unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1) (FRintj INT -1) (ACC40Si INT -1) (ACCGi INT -1)) ; inputs
+ ((FRintk INT -1) (ACC40Sk INT -1) (ACC40Uk INT -1) (ACCGk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Quad Arithmetic unit
+ (unit u-media-quad-arith "Media Quad Arithmetic unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1) (FRintj INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual Multiplication unit
+ (unit u-media-dual-mul "Media Dual Multiplication unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1) (FRintj INT -1)) ; inputs
+ ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Quad Multiplication unit
+ (unit u-media-quad-mul "Media Quad Multiplication unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1) (FRintj INT -1)) ; inputs
+ ((ACC40Sk INT -1) (ACC40Uk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Quad Complex unit
+ (unit u-media-quad-complex "Media Quad Complex unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1) (FRintj INT -1)) ; inputs
+ ((ACC40Sk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual Expand unit
+ (unit u-media-dual-expand "Media Dual Expand unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual Unpack unit
+ (unit u-media-dual-unpack "Media Dual Unpack unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRinti INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual byte to half unit
+ (unit u-media-dual-btoh "Media Byte to byte" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRintj INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual half to byte unit
+ (unit u-media-dual-htob "Media Half to byte" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRintj INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Media Dual byte to half unit extended
+ (unit u-media-dual-btohe "Media Byte to byte extended" ()
+ 1 1 ; issue done
+ () ; state
+ ((FRintj INT -1)) ; inputs
+ ((FRintk INT -1)) ; outputs
+ () ; profile action (default)
+ )
+ ; Barrier unit
+ (unit u-barrier "Barrier unit" ()
+ 1 1 ; issue done
+ () ; state
+ () ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Memory Barrier unit
+ (unit u-membar "Memory Barrier unit" ()
+ 1 1 ; issue done
+ () ; state
+ () ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Insn cache invalidate unit
+ (unit u-ici "Insn cache invalidate unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Data cache invalidate unit
+ (unit u-dci "Data cache invalidate unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Data cache flush unit
+ (unit u-dcf "Data cache flush unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Insn cache preload unit
+ (unit u-icpl "Insn cache preload unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Data cache preload unit
+ (unit u-dcpl "Data cache preload unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Insn cache unlock unit
+ (unit u-icul "Insn cache unlock unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; Data cache unlock unit
+ (unit u-dcul "Data cache unlock unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRi INT -1) (GRj INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+ ; commit unit
+ (unit u-commit "Commit Unit" ()
+ 1 1 ; issue done
+ () ; state
+ ((GRk INT -1) (FRk INT -1)) ; inputs
+ () ; outputs
+ () ; profile action (default)
+ )
+)
+\f
+; Tomcat machine. Early version of fr500 machine
+(define-mach
+ (name tomcat)
+ (comment "Tomcat -- early version of fr500")