Skip to content

Commit

Permalink
Update pipeline doc
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Feb 19, 2024
1 parent d59d0fc commit d5c7638
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions source/SpinalHDL/Libraries/Pipeline/introduction.rst
Original file line number Diff line number Diff line change
Expand Up @@ -602,36 +602,29 @@ Here is how it can be done with this pipelining API :
// Let's define the Nodes for our pipeline
val nodes = Array.fill(resultAt+1)(Node())
// Let's specify which node will be used for what part of the pipeline
val insertNode = nodes(0)
val addNode = nodes(addAt)
val invNode = nodes(invAt)
val mulNode = nodes(mulAt)
val resultNode = nodes(resultAt)
// Define the hardware which will feed the io.up stream into the pipeline
val inserter = new insertNode.Area {
val inserter = new nodes(0).Area {
arbitrateFrom(io.up)
val RGB = insert(io.up.payload)
}
// sum the r g b values of the color
val adder = new addNode.Area {
val adder = new nodes(addAt).Area {
val SUM = insert(inserter.RGB.r + inserter.RGB.g + inserter.RGB.b)
}
// flip all the bit of the RGB sum
val inverter = new invNode.Area {
val inverter = new nodes(invAt).Area {
val INV = insert(~adder.SUM)
}
// multiply the inverted bits with 0xEE
val multiplier = new mulNode.Area {
val multiplier = new nodes(mulAt).Area {
val MUL = insert(inverter.INV*0xEE)
}
// Connect the end of the pipeline to the io.down stream
val resulter = new resultNode.Area {
val resulter = new nodes(resultAt).Area {
arbitrateTo(io.down)
io.down.payload := multiplier.MUL
}
Expand Down

0 comments on commit d5c7638

Please sign in to comment.