//==- RISCVSchedSyntacoreSCR3.td - Syntacore SCR3 Scheduling Definitions -*- tablegen -*-=// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// //===----------------------------------------------------------------------===// // This model covers SYNTACORE_SCR3_RV32IMC and SYNTACORE_RV64IMAC // configurations (syntacore-scr3-rv32/64). // Overview: https://syntacore.com/products/scr3 // SCR3 is single-issue in-order processor class SyntacoreSCR3Model : SchedMachineModel { let MicroOpBufferSize = 0; let IssueWidth = 1; let LoadLatency = 2; let MispredictPenalty = 3; let CompleteModel = 0; let UnsupportedFeatures = [HasStdExtD, HasStdExtZbkb, HasStdExtZbkc, HasStdExtZbkx, HasStdExtZknd, HasStdExtZkne, HasStdExtZknh, HasStdExtZksed, HasStdExtZksh, HasStdExtZkr, HasVInstructions]; } // Branching multiclass SCR3_Branching { def : WriteRes; def : WriteRes; def : WriteRes; } // Single-cycle integer arithmetic and logic multiclass SCR3_IntALU { def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; } // Integer multiplication multiclass SCR3_IntMul { let Latency = 2 in { def : WriteRes; def : WriteRes; } } // Integer division multiclass SCR3_IntDiv { let Latency = DivLatency, ReleaseAtCycles = [DivLatency] in { def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; } } // Load/store instructions on SCR3 have latency 2 multiclass SCR3_Memory { let Latency = 2 in { def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; } } // Atomic memory multiclass SCR3_AtomicMemory { let Latency = 20 in { def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; def : WriteRes; } } // Others multiclass SCR3_Other { def : WriteRes; def : WriteRes; def : InstRW<[WriteIALU], (instrs COPY)>; } multiclass SCR3_Unsupported { defm : UnsupportedSchedD; defm : UnsupportedSchedF; defm : UnsupportedSchedSFB; defm : UnsupportedSchedV; defm : UnsupportedSchedXsfvcp; defm : UnsupportedSchedZabha; defm : UnsupportedSchedZba; defm : UnsupportedSchedZbb; defm : UnsupportedSchedZbc; defm : UnsupportedSchedZbs; defm : UnsupportedSchedZbkb; defm : UnsupportedSchedZbkx; defm : UnsupportedSchedZfa; defm : UnsupportedSchedZfh; defm : UnsupportedSchedZvk; } // Bypasses (none) multiclass SCR3_NoReadAdvances { def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; def : ReadAdvance; } def SyntacoreSCR3RV32Model : SyntacoreSCR3Model; let SchedModel = SyntacoreSCR3RV32Model in { let BufferSize = 0 in { def SCR3RV32_ALU : ProcResource<1>; def SCR3RV32_MUL : ProcResource<1>; def SCR3RV32_DIV : ProcResource<1>; def SCR3RV32_LSU : ProcResource<1>; def SCR3RV32_CFU : ProcResource<1>; } defm : SCR3_Branching; defm : SCR3_IntALU; defm : SCR3_IntMul; defm : SCR3_IntDiv; defm : SCR3_Memory; defm : SCR3_AtomicMemory; defm : SCR3_Other; defm : SCR3_Unsupported; defm : SCR3_NoReadAdvances; } def SyntacoreSCR3RV64Model : SyntacoreSCR3Model; let SchedModel = SyntacoreSCR3RV64Model in { let BufferSize = 0 in { def SCR3RV64_ALU : ProcResource<1>; def SCR3RV64_MUL : ProcResource<1>; def SCR3RV64_DIV : ProcResource<1>; def SCR3RV64_LSU : ProcResource<1>; def SCR3RV64_CFU : ProcResource<1>; } defm : SCR3_Branching; defm : SCR3_IntALU; defm : SCR3_IntMul; defm : SCR3_IntDiv; defm : SCR3_Memory; defm : SCR3_AtomicMemory; defm : SCR3_Other; defm : SCR3_Unsupported; defm : SCR3_NoReadAdvances; }