ucb-bar / chisel2-deprecated

chisel.eecs.berkeley.edu
387 stars 90 forks source link

Adding risingedge() function in ChiselUtil package #553

Open Martoni opened 8 years ago

Martoni commented 8 years ago

risingedge function is given as example in Chisel tutorial :

def risingedge(x: Bool) = x && !Reg(next = x)

It's a really usefull function I redefine in lot of module in my projects. It can be a good idea to add it in ChiselUtil package to avoid duplicate code everywhere no ?

We can also add fallingedge and bothedge maybe.