Questions tagged [lava]

A Domain Specific Language (DSL) for expressing hardware-oriented descriptions of computations.

Kansas Lava is a Domain Specific Language (DSL) for expressing hardware-oriented descriptions of computations, and is hosted inside the language Haskell.

More information available here.

12 questions
38
votes
1 answer

Multiple assignments to the same register in an RTL block with Kansas Lava

I'm having trouble understanding Kansas Lava's behaviour when an RTL block contains multiple assignments to the same register. Here's version number 1: foo :: (Clock c) => Signal clk Bool foo = runRTL $ do r <- newReg True r := low …
Cactus
  • 27,075
  • 9
  • 69
  • 149
9
votes
1 answer

Interrupt behavior of a 6502 in standalone test vs. in a Commodore PET

I am building a Commodore PET on an FPGA. I've implemented my own 6502 core in Kansas Lava (code is available at https://github.com/gergoerdi/mos6502-kansas-lava), and by putting enough IO around it…
Cactus
  • 27,075
  • 9
  • 69
  • 149
8
votes
2 answers

What's the difference between Chisel and Lava and CLaSH?

I've been studying the sources of Chisel and also various Lavas (Kansas, Chalmers and Xilinx flavors) and CLaSH. I'm trying to understand what's the main selling points of Chisel versus the others. The main one I've identified is fast simulation. I…
Michael Fox
  • 3,632
  • 1
  • 17
  • 27
6
votes
1 answer

Indexing a matrix of matrices with a signal in Kansas Lava

I'm trying to implement temporal multiplexing to drive a 7-segment display with 4 digits: the device has 7 data legs and 4 anodes, so if you want to display four different digits, you have to set the anodes to 0001 first and the data legs to your…
Cactus
  • 27,075
  • 9
  • 69
  • 149
4
votes
1 answer

Converting York Lava function to Kansas Lava

I have here a York Lava function that I want to rewrite in Kansas Lava. But it doesn't want to work and I don't know I should do it actually. Can someone help me with this please? {-Serial In - Parallel Out shiftregister. The serial bit is inserted…
Daan Mouha
  • 580
  • 1
  • 6
  • 20
2
votes
1 answer

Haskell bit to bool error

I'm writing a function which converts a bit to a bool in Kansas Lava. I can do this in two ways but neither of them works. The function must do the following: Receive a bit (low or high) Convert it to its corresponding boolean => False if it's low…
Daan Mouha
  • 580
  • 1
  • 6
  • 20
1
vote
0 answers

Equivalence verification using Lava

I've been trying to verify equivalence property between two circuits in Chalmers Lava. I have declared a type bit: type Bit = Signal Bool And I have two circuits each has a list of bits as input and a tuple of lists of bits, and a function that…
Balkis
  • 103
  • 7
1
vote
1 answer

Haskell/Kansas Lava shift register errors

I got a piece of code from a kansas-lava paper, that works. counter :: Signal CLK Bool -> Signal CLK Bool -> Signal CLK Int counter restart inc = loop where reg = register 0 loop reg' = mux restart (0, reg) loop = mux inc (reg' + 1,…
Daan Mouha
  • 580
  • 1
  • 6
  • 20
0
votes
0 answers

coding a gradient function with weights, also adding more than one color

I've been hard at work for a school assignment involving shadertoy, which uses GLSL. The project is to make a "distorted" fragment shader, and I figured that I could make mine a slowly moving stream of magma. Essentially what I want to do is make a…
0
votes
1 answer

Haskell type constructor in generic function

I'm digging around in the Haskell Lava HDL system and am stuck in understanding http://hackage.haskell.org/package/chalmers-lava2000-1.6.1/docs/src/Lava-Vhdl.html#writeVhdl Can someone tell me what function (var "inp") in writeVhdlresolves to?…
Konrad Eisele
  • 3,088
  • 20
  • 35
0
votes
1 answer

From Signal Int to Int in Haskell

I am working with a Haskell libraby that discribes digital circuits (Lava), its function inputs and outputs are of the type signal ( Signal Bool , Signal Int) , as far as i know there is not a function that converts from a Signal Int to Int, I know…
Balkis
  • 103
  • 7
0
votes
0 answers

Assigning to output signal and changing register value from the same branch in an RTL block

In VHDL, I can write something like this to change the value stored in the register COUNTER and assign to an output signal from the same branch of a condition: entity AssignTest is port (CLK: in std_logic; OUTPUT: out std_logic_vector(1…
Cactus
  • 27,075
  • 9
  • 69
  • 149