-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6a2f0e2
commit 0b72f76
Showing
7 changed files
with
43 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package fuselang | ||
|
||
import java.io.File | ||
|
||
import backend.{VivadoBackend, CppRunnable, Backend} | ||
|
||
object Configuration { | ||
|
||
sealed trait Mode | ||
final case object Compile extends Mode | ||
final case object Run extends Mode | ||
|
||
val emptyConf = Config(null) | ||
|
||
val validBackends = Set("vivado", "c++") | ||
|
||
def toBackend(str: String): Backend = str match { | ||
case "vivado" => VivadoBackend | ||
case "c++" => CppRunnable | ||
case b => throw CompilerError.Impossible("toBackend", s"Unknown backend $b") | ||
} | ||
|
||
case class Config( | ||
srcFile: File, // Required: Name of the source file | ||
kernelName: String = "kernel", // Name of the kernel to emit | ||
output: Option[String] = None, // Name of output file. | ||
backend: Backend = VivadoBackend, // Backend used for code generation | ||
mode: Mode = Compile, // Compilation mode | ||
compilerOpts: List[String] = List(), // Extra options to the generateExec Compiler | ||
header: Boolean = false, // Generate a header | ||
logLevel: scribe.Level = scribe.Level.Info | ||
) | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters