Giter Site home page Giter Site logo

Comments (6)

ducky64 avatar ducky64 commented on September 24, 2024 1

Ah. So Decoupled provides a default constructor that fills in the EmptyBundle for you.

For now, see if the above works: myDecoupled.enqueueNow(new EmptyBundle().Lit())

In the longer term, since this empty-Decoupled is part of the chisel API, it might make some sense to add support for it in ChiselTest. I'm not sure if we can match on DecoupledIO[EmptyBundle] to define a specialized implicit, or if we want to add something like an empty enqueue that would rely on a runtime check.

from chiseltest.

erlingrj avatar erlingrj commented on September 24, 2024 1

Thanks again. It turned out the correct syntax was

myDecoupled.enqueueNow(chiselTypeOf(myDecoupled.bits))

from chiseltest.

ducky64 avatar ducky64 commented on September 24, 2024

What does your Decoupled interface look like? It has to take some data type, right - even if that type is an empty Bundle or 0-wide integer (not sure if the latter is allowed)? Can you call enqueue/dequeue, passing in that data type?

I'd not be a huge fam of having enqueueEmpty or dequeueEmpty because it wouldn't be valid for most Decoupled interfaces, and especially if the compositional approach works, like myDecoupled.enqueueNow(EmptyBundle().Lit()).

from chiseltest.

erlingrj avatar erlingrj commented on September 24, 2024

No, I dont specify any data type. Like this: https://scastie.scala-lang.org/dmjRHxryTYW5Sif9HiJHiA I was actually surprised that you could have an empty Decoupled signal.

from chiseltest.

erlingrj avatar erlingrj commented on September 24, 2024

Thanks for your help. I tried your suggestion, but EmptyBundle is a private class inside Decoupled, so not available. I made my own copy of it, but that gave a "Record type mismatch" error at the "x.bits.poke(data)" statement in the enqueue driver.

from chiseltest.

ducky64 avatar ducky64 commented on September 24, 2024

I see. How about this?

myDecoupled.enqueueNow(chiselTypeOf(myDecoupled.bits).Lit())

from chiseltest.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.