This file contains hidden or 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
| import dfhdl.* | |
| class cell_histogram( | |
| val IMAGE_WIDTH: Int <> CONST = 640, | |
| val INPUT_BIN_WIDTH: Int <> CONST = 11, | |
| val OUTPUT_BIN_WIDTH: Int <> CONST = 14 | |
| ) extends EDDesign: | |
| val BINS: Int <> CONST = 9 + 1 | |
| val PARTIAL_HISTOGRAM_WIDTH: Int <> CONST = INPUT_BIN_WIDTH * BINS | |
| val CELLS_PER_ROW: Int <> CONST = IMAGE_WIDTH / 8 | |
| val histogram_adder = new partial_histogram_add( |
This file contains hidden or 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
| import dfhdl.* | |
| class cell_histogram( | |
| val IMAGE_WIDTH: Int <> CONST = 640, | |
| val INPUT_BIN_WIDTH: Int <> CONST = 11, | |
| val OUTPUT_BIN_WIDTH: Int <> CONST = 14 | |
| ) extends EDDesign: | |
| val BINS: Int <> CONST = 9 + 1 | |
| val PARTIAL_HISTOGRAM_WIDTH: Int <> CONST = INPUT_BIN_WIDTH * BINS | |
| val CELLS_PER_ROW: Int <> CONST = IMAGE_WIDTH / 8 | |
| val cell_buff = new lin_buff( |
This file contains hidden or 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
| import dfhdl.* | |
| class binning( | |
| val DATA_WIDTH: Int <> CONST = 8, | |
| val IMAGE_WIDTH: Int <> CONST = 640, | |
| val IMAGE_HEIGHT: Int <> CONST = 480 | |
| ) extends EDDesign: | |
| val image_line_buff = new lin_buff( | |
| BUFFER_WIDTH = DATA_WIDTH, BUFFER_DEPTH = IMAGE_WIDTH, | |
| BLOCK_WIDTH = 3, BLOCK_HEIGHT = 3) |
This file contains hidden or 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
| import dfhdl.* | |
| // unreferenced by anything; present in the compilation unit only | |
| class abs(val DATA_WIDTH: Int <> CONST = 8) extends EDDesign: | |
| val i = Bits(DATA_WIDTH) <> IN | |
| val o = Bits(DATA_WIDTH) <> OUT | |
| o <> i |
This file contains hidden or 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
| import dfhdl.* | |
| class abs( | |
| val DATA_WIDTH: Int <> CONST = 8 | |
| ) extends EDDesign: | |
| val data_in1, data_in2 = Bits(DATA_WIDTH + 1) <> IN | |
| val is_upper_bin = Bit <> OUT | |
| val data_out1, data_out2 = Bits(DATA_WIDTH) <> OUT | |
| val input_sign1, input_sign2 = Bit <> VAR |
This file contains hidden or 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
| package AES | |
| import dfhdl.{apply => _, *} | |
| export dfhdl.apply | |
| import scala.annotation.targetName | |
| ////////////////////////////////////////////////////////////////////////////////////////////////////// | |
| // AES Byte | |
| ////////////////////////////////////////////////////////////////////////////////////////////////////// |
This file contains hidden or 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
| ``` | |
| Exception in thread "pool-5-thread-2" java.lang.AssertionError: assertion failed: asTerm called on not-a-Term val <none> | |
| at scala.runtime.Scala3RunTime$.assertFailed(Scala3RunTime.scala:8) | |
| at dotty.tools.dotc.core.Symbols$Symbol.asTerm(Symbols.scala:163) | |
| at dotty.tools.dotc.ast.tpd$.New(tpd.scala:494) | |
| at dotty.tools.dotc.core.Annotations$Annotation$.apply(Annotations.scala:191) | |
| at dotty.tools.dotc.core.Annotations$Annotation$.apply(Annotations.scala:182) | |
| at dotty.tools.dotc.core.classfile.ClassfileParser.parseAttribute$1(ClassfileParser.scala:734) | |
| at dotty.tools.dotc.core.classfile.ClassfileParser.parseAttributes$$anonfun$1(ClassfileParser.scala:792) | |
| at scala.runtime.java8.JFunction1$mcVI$sp.apply(JFunction1$mcVI$sp.scala:18) |
This file contains hidden or 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
| error] dotty.tools.dotc.core.Denotations$StaleSymbol: stale symbol; type OutW#32239 in trait CompanionsDFBits$Token$Candidate, defined in Period(1..55, run = 2), is referred to in run Period(1..1, run = 3) | |
| [error] dotty.tools.dotc.core.Denotations$SingleDenotation.staleSymbolError(Denotations.scala:955) | |
| [error] dotty.tools.dotc.core.Denotations$SingleDenotation.bringForward(Denotations.scala:754) | |
| [error] dotty.tools.dotc.core.Denotations$SingleDenotation.toNewRun$1(Denotations.scala:803) | |
| [error] dotty.tools.dotc.core.Denotations$SingleDenotation.current(Denotations.scala:877) | |
| [error] dotty.tools.dotc.core.Symbols$Symbol.recomputeDenot(Symbols.scala:122) | |
| [error] dotty.tools.dotc.core.Symbols$Symbol.computeDenot(Symbols.scala:116) | |
| [error] dotty.tools.dotc.core.Symbols$Symbol.denot(Symbols.scala:109) | |
| [error] dotty.tools.dotc.core.Symbols$.toDenot(Symbols.scala:494) | |
| [error] dotty.tools.dotc.core.Types$NamedType.derivedSelect(Types.scala:2493) |
This file contains hidden or 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 is a DFiant-equivalent design of https://github.com/tommythorn/silice-examples/blob/master/cpu.ice | |
| import DFiant.* | |
| class CPU(using DFC) extends DFDesign: | |
| val leds = DFBits(8) <> OUT | |
| val rf = DFBits(32).X(16) <> VAR init Vector( | |
| 0, 1, 1, 0, 100, 0, 1 | |
| ).padTo(16, 0).map(_.toBits(32)) | |
| // A add, B blt | |
| val code = DFBits(32).X(32) const Vector( |
This file contains hidden or 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
| 2019-12-24 00:34:03 | |
| Full thread dump Java HotSpot(TM) 64-Bit Server VM (25.231-b11 mixed mode): | |
| "classloader-cache-cleanup-0" #13 daemon prio=5 os_prio=0 tid=0x00000000560d6000 nid=0x41c in Object.wait() [0x000000005b2ef000] | |
| java.lang.Thread.State: TIMED_WAITING (on object monitor) | |
| at java.lang.Object.wait(Native Method) | |
| - waiting on <0x00000000c14784a8> (a java.lang.ref.ReferenceQueue$Lock) | |
| at java.lang.ref.ReferenceQueue.remove(Unknown Source) | |
| - locked <0x00000000c14784a8> (a java.lang.ref.ReferenceQueue$Lock) | |
| at sbt.internal.classpath.ClassLoaderCache$CleanupThread.run(ClassLoaderCache.scala:102) |
NewerOlder