Permalink
Browse files

linebuffer seems to work

  • Loading branch information...
jameshegarty committed Jun 18, 2015
1 parent 3c03395 commit 746131d9967571e65ed6c30edffb342d3bbafefa
Showing with 190 additions and 93 deletions.
  1. +4 −3 darkroom.t
  2. +1 −1 examples/shifty_wide_handshake.t
  3. BIN examples/stripe.bmp
  4. BIN examples/stripe.raw
  5. +183 −88 src/systolic.t
  6. +2 −1 systolic.md
View
@@ -862,13 +862,14 @@ function darkroom.linebuffer( A, w, h, T, ymin )
local BRAM = res.systolicModule:add( S.module.bramSDP( true, (w/T)*darkroom.extract(res.inputType):verilogBits()/8, bits, bits, {CE=true}, init ):instantiate("lb_m"..math.abs(y)))
-- local BRAM = res.systolicModule:add( S.module.bram2KSDP( true, darkroom.extract(res.inputType), init ):instantiate("lb_m"..math.abs(y)))
- evicted = BRAM:writeAndReturnOriginal( S.tuple{ S.cast(addr:get(),types.uint(4)), S.cast(lbinp,types.bits(64))} )
+ local addrbits = math.log(((w/T)*darkroom.extract(res.inputType):verilogBits())/bits)/math.log(2)
+ evicted = BRAM:writeAndReturnOriginal( S.tuple{ S.cast(addr:get(),types.uint(addrbits)), S.cast(lbinp,types.bits(bits))} )
evicted = S.cast( evicted, darkroom.extract(res.inputType) )
end
end
- res.systolicModule:addFunction( S.lambda("process", sinp, S.cast( S.tuple( outarray ), darkroom.extract(res.outputType) ), "process_output", {addr:set(S.constant(1, types.uint(16)))} ) )
- res.systolicModule:addFunction( S.lambda("reset", S.parameter("r",types.null()), nil, "ro" ) )
+ res.systolicModule:addFunction( S.lambda("process", sinp, S.cast( S.tuple( outarray ), darkroom.extract(res.outputType) ), "process_output", {addr:setBy(S.constant(1, types.uint(16)))} ) )
+ res.systolicModule:addFunction( S.lambda("reset", S.parameter("r",types.null()), nil, "ro", {addr:set(S.constant(0,types.uint(16)))},S.parameter("reset",types.bool())) )
return darkroom.newFunction(res)
end
@@ -21,7 +21,7 @@ out = d.apply("shifty_wide", hsfn, out )
out = d.apply("fwrite", d.makeHandshake(d.fwriteSeq("out/shifty_wide_handshake.raw",RAWTYPE,"shifty_wide_handshake.sim.raw")), out )
top = d.lambda( "top", inp, out )
-------------
-f = d.seqMapHandshake( top, W, H, T,false, 2 )
+f = d.seqMapHandshake( top, W, H, T, false, 2 )
Module = f:compile()
(terra() var m:Module; m:reset(); m:process(nil,nil) end)()
View
Binary file not shown.
View
Binary file not shown.
Oops, something went wrong.

0 comments on commit 746131d

Please sign in to comment.