object KernelFileUtils
Kernel file utilities
- Alphabetic
- By Inheritance
- KernelFileUtils
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @IntrinsicCandidate() @native()
- def confirmFileParentPath(file: File): Boolean
Create parent directory for file creation
Create parent directory for file creation
- file
target file
- returns
is parent dir created
- def createIpFileCache(ipFile: File, hash: Option[String] = None)(implicit project: ScaledaProject): Unit
Update ip cache, extract .xcix file to (cacheDir)/(file hash).
Update ip cache, extract .xcix file to (cacheDir)/(file hash). If targetDirectory exists and not empty, do nothing
- ipFile
ip file, simple target ip
- hash
optional hash, if not provided, will calculate hash from file
- def deleteDirectory(path: Path): Unit
Remove a directory in recursive mode
Remove a directory in recursive mode
- path
must be a directory
- def doUpdateIpFilesCache(ipFiles: Set[String])(implicit project: ScaledaProject): Unit
Operations to update ipFiles cache.
1.Operations to update ipFiles cache.
1. calculate ip file hash 2. remove unused cache by hash 3. update cache directory- ipFiles
ip files field in top.scaleda.kernel.project.config.ConfigNode (from
getIpFiles
)
- def doUpdateIpStubsCache(ips: Map[String, ProjectConfig], instances: Seq[IPInstance], stubsCacheDir: File): Unit
Manage IP Stubs cache
Manage IP Stubs cache
- ips
collected ip info
- instances
collected ip instances (context info)
- stubsCacheDir
target dir (projectBase/.cache)
- def doUpdateStubCacheFromProject(implicit project: ScaledaProject): Unit
Update stubs in ProjectConfig
- def doUpdateStubCacheFromRuntime(rt: ScaledaRuntime)(implicit project: ScaledaProject): Seq[File]
Update stubs cache from runtime
Update stubs cache from runtime
- rt
runtime
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- def getAllCachedIpHash(implicit project: ScaledaProject): Set[String]
- def getAllSourceFiles(sources: Set[String], suffix: Set[String] = Set("v"))(implicit project: ScaledaProject): Seq[File]
Get all source files from a source set.
Get all source files from a source set.
- sources
list of paths, each item can be file or dir, empty string will be dropped
- suffix
filter by file type
- returns
list of files
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def getModuleFileFromSet(sources: Set[String], module: String)(implicit project: ScaledaProject): Option[File]
Get the verilog file containing specific module from one file set
Get the verilog file containing specific module from one file set
- sources
file set
- module
module name
- returns
optional file
- def getModuleTitle(verilogFile: File): Seq[String]
Get module titles inside a file.
Get module titles inside a file.
- verilogFile
the file
- returns
Seq[String]: All module titles in that file
- def handleIpInstances(task: TaskConfig, targetDirectory: File, targetAction: Set[String])(implicit manifest: ScaledaProject): Seq[File]
Handle IP instances, filter, do renders
Handle IP instances, filter, do renders
- returns
generated sources
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @IntrinsicCandidate() @native()
- def insertAfterModuleHead(original: File, output: File, moduleName: String, insert: String): Int
Insert content after module head
Insert content after module head
- original
file from
- output
file to
- moduleName
target module name
- insert
content to insert
- returns
line where content inserts
- def ipCacheDirectory(implicit project: ScaledaProject): File
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- def isLegalName(s: String): Boolean
Check whether a file name is legal.
Check whether a file name is legal. This is also applied to project, target & task names, for they will be used to create files / directories.
- s
the string
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @IntrinsicCandidate() @native()
- def parseAsAbsolutePath(path: String)(implicit project: ScaledaProject): String
Get absolute paths for a string based on projectBase, fallback to path itself
Get absolute paths for a string based on projectBase, fallback to path itself
- path
path
- def parseIpInDirectory(path: File): Option[ProjectConfig]
Get ProjectConfig from IP directory
Get ProjectConfig from IP directory
- path
ip path
- returns
optional ProjectConfig
- def parseIpParentDirectory(path: File): Map[String, ProjectConfig]
- def removeIpFileCache(hash: String)(implicit project: ScaledaProject): Unit
Remove an ip cache by hash
Remove an ip cache by hash
- hash
ip file hash
- def scanDirectory(suffixing: Set[String], directory: File, level: Int = 0, maxLevel: Int = 128): Seq[File]
Recursively scan a directory for given type of file
Recursively scan a directory for given type of file
- suffixing
Set of extensions
- directory
the directory
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toCanonicalPath(path: String)(implicit project: ScaledaProject): Option[String]
Convert any path into an canonical path.
Convert any path into an canonical path. For relative path, it is calculated base on project base.
⚠️ Only work on same OS. Cannot process Window paths on Linux now.- path
the original path string
- returns
None iff no project base AND relative path; Otherwise an canonical path will be returned
- def toProjectRelativePath(path: String)(implicit project: ScaledaProject): Option[String]
Convert any path into an project relative path.
⚠️ Only work on same OS.Convert any path into an project relative path.
⚠️ Only work on same OS. Cannot process Window paths on Linux now.- path
the original path string
- returns
None iff no project base OR path can not be relativised; Otherwise a relative path will be returned
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated
(Since version 9)