Code Monkey home page Code Monkey logo

Comments (3)

cpitclaudel avatar cpitclaudel commented on June 30, 2024 1

I might be approaching this wrong, but my problem is that my Koika design will be part of a larger design, and the larger design is not combinational. To get signals in/out of my design I have been using external functions with efr_internal := false to expose input output signals in the verilog interface - perhaps there is another way to achieve this?

You're doing it right, but it requires extra care because Kôika doesn't have a good story about its module system at the moment. I summarized this in #2 (comment) , and there are more details about this in #10 ; the first link in particular has a pretty detailed description of how to do this safely (the main example we have of this is the bus in the RISCV core. If you want me to look at a concrete case I'll be happy to give design-specific advice.

from koika.

cpitclaudel avatar cpitclaudel commented on June 30, 2024

This is correct behavior, although it can be unexpected: functions are specified to be pure (they need to have a pure model), so if their return value is unused they can be eliminated.

The trick to force them to be kept is to use the return value, e.g. by writing it to a dummy register, as you noticed.

I don't understand your second example too well — what is it about the nonconstant value?

(This will be fixed when we have proper support for modules, since function calls will become observable and hence not tivially optimizable)

from koika.

blaxill avatar blaxill commented on June 30, 2024

This is correct behavior, although it can be unexpected: functions are specified to be pure (they need to have a pure model), so if their return value is unused they can be eliminated.

I might be approaching this wrong, but my problem is that my Koika design will be part of a larger design, and the larger design is not combinational. To get signals in/out of my design I have been using external functions with efr_internal := false to expose input output signals in the verilog interface - perhaps there is another way to achieve this?

I don't understand your second example too well — what is it about the nonconstant value?

I just noticed that the external call was dropped with write0 (dummy, Ob~0) but not with write0 (dummy, previous_total), (still_dropped not mentioned in either).

from koika.

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.