CircuitSerializationAnnotation

chisel3.stage.CircuitSerializationAnnotation
See theCircuitSerializationAnnotation companion object
class CircuitSerializationAnnotation extends NoTargetAnnotation, BufferedCustomFileEmission, WriteableCircuitAnnotation, Product, Serializable

Wraps a Circuit for serialization via CustomFileEmission

Value parameters

circuit

a Chisel Circuit

filename

name of destination file (excludes file extension)

format

serialization file format (sets file extension)

Attributes

Companion
object
Source
ChiselAnnotations.scala
Graph
Supertypes
trait Serializable
trait WriteableCircuitAnnotation
trait Annotation
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Members list

Value members

Deprecated constructors

def this(circuit: Circuit, filename: String, format: Format)

Attributes

Deprecated
[Since version Chisel 6.7.0] Construct with ElaboratedCircuit instead
Source
ChiselAnnotations.scala

Concrete methods

override def canEqual(that: Any): Boolean

Attributes

Definition Classes
Equals
Source
ChiselAnnotations.scala
def emitLazily(annos: Seq[Annotation]): Iterable[String]

Emit the circuit including annotations

Emit the circuit including annotations

Attributes

Note

This API is lazy to improve performance and enable emitting circuits larger than 2 GiB

Source
ChiselAnnotations.scala
override def equals(obj: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Equals -> Any
Source
ChiselAnnotations.scala
override def getBytesBuffered: Iterable[Array[Byte]]

A buffered version of getBytes for more efficient serialization

A buffered version of getBytes for more efficient serialization

If you only need to serialize an Iterable[String], you can use the String.getBytes method. It's also helpful to create a view which will do the .map lazily instead of eagerly, improving GC performance.

def getBytesBuffered: Iterable[Array[Byte]] = myListString.view.map(_.getBytes)

Attributes

Definition Classes
Source
ChiselAnnotations.scala
override def productArity: Int

Attributes

Definition Classes
Product
Source
ChiselAnnotations.scala
def productElement(n: Int): Any

Attributes

Source
ChiselAnnotations.scala

Deprecated methods

def circuit: Circuit

Attributes

Deprecated
[Since version Chisel 6.7.0] Use elaboratedCircuit instead
Source
ChiselAnnotations.scala
def copy(circuit: Circuit = ..., filename: String = ..., format: Format = ...): CircuitSerializationAnnotation

Attributes

Deprecated
[Since version Chisel 6.7.0] Don\'t copy, just create a new one.
Source
ChiselAnnotations.scala

Inherited methods

final def filename(annotations: AnnotationSeq): File

Method that returns the filename where this annotation will be serialized.

Method that returns the filename where this annotation will be serialized.

Value parameters

annotations

the annotations at the time of serialization

Attributes

Inherited from:
CustomFileEmission
Source
StageAnnotations.scala
final def getBytes: Iterable[Byte]

A method that can convert this annotation to bytes that will be written to a file.

A method that can convert this annotation to bytes that will be written to a file.

If you only need to serialize a string, you can use the getBytes method:

def getBytes: Iterable[Byte] = myString.getBytes

Attributes

Inherited from:
BufferedCustomFileEmission
Source
StageAnnotations.scala
def productElementName(n: Int): String

Attributes

Inherited from:
Product
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def productPrefix: String

Attributes

Inherited from:
Product
def replacements(file: File): AnnotationSeq

Optionally, a sequence of annotations that will replace this annotation in the output annotation file.

Optionally, a sequence of annotations that will replace this annotation in the output annotation file.

A non-empty implementation of this method is a mechanism for telling a downstream Stage how to deserialize the information that was serialized to a separate file. For example, if a FIRRTL circuit is serialized to a separate file, this method could include an input file annotation that a later stage can use to read the serialized FIRRTL circuit back in.

Attributes

Inherited from:
CustomFileEmission
Source
StageAnnotations.scala
def serialize: String

Optional pretty print

Optional pretty print

Attributes

Note

rarely used

Inherited from:
Annotation
Source
Annotation.scala
def update(renames: RenameMap): Seq[NoTargetAnnotation]

Update the target based on how signals are renamed

Update the target based on how signals are renamed

Attributes

Inherited from:
NoTargetAnnotation
Source
Annotation.scala

Concrete fields

val filename: String

Attributes

Source
ChiselAnnotations.scala
val format: Format

Attributes

Source
ChiselAnnotations.scala
lazy override val hashCode: Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Source
ChiselAnnotations.scala