Skip to content

Commit

Permalink
Fix SpinalHDL/SpinalHDL#579 (Map usage)
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Jan 17, 2022
1 parent 18963b6 commit 1a007fa
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions crypto/src/main/scala/spinal/crypto/devtype/DevTypes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ abstract class DNode{
}


def processGraphWithInput(node: DNode, inputs: Map[DNode, Boolean]): Boolean = {
def processGraphWithInput(node: DNode, inputs: mutable.LinkedHashMap[DNode, Boolean]): Boolean = {

// rebuild the graph with the given value
def parseTree(n: DNode): List[DNode] = n match {
Expand Down Expand Up @@ -330,7 +330,8 @@ abstract class DNode{
val result = ListBuffer[Int]()
for(i <- 0 until math.pow(2, variables.size).toInt){
val binValue = BigIntToListBoolean(i, variables.size bits)
val map = variables.zip(binValue).toMap
val map = mutable.LinkedHashMap[DNode, Boolean]()
variables.zip(binValue).foreach(e => map.update(e._1, e._2))

if(processGraphWithInput(this, map)){
result += i
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,14 @@
\* */
package spinal.crypto.primitive.keccak

import scala.collection.mutable

object Keccak {

/**
* The rotation offsets r[x,y]
*/
private var pRawOffset : Map[(Int, Int), Int] = Map((0,0) -> 0)
private var pRawOffset : mutable.LinkedHashMap[(Int, Int), Int] = mutable.LinkedHashMap((0,0) -> 0)


/**
Expand Down

0 comments on commit 1a007fa

Please sign in to comment.