Permalink
Browse files

Soc (#108)

* Initial work on allowing Rigel to generate full AXI interfaces
* removed const nonsense
  • Loading branch information...
jameshegarty committed Mar 29, 2018
1 parent 2c3295e commit 295cab5f56dcf2bd53374911a69956d92187c393
View
@@ -0,0 +1 @@
o
View
@@ -76,7 +76,7 @@ local function makeThresh()
if TAPS==false then
local THRESH=10
local inp = R.input( types.uint(8) )
local out = R.apply("rr", thfn, R.concat("rof",{inp,R.constant("Rt",THRESH,types.uint(32):makeConst())}))
local out = R.apply("rr", thfn, R.concat("rof",{inp,R.constant("Rt",THRESH,types.uint(32))}))
thfn = RM.lambda("EWR",inp,out)
end
@@ -1149,6 +1149,9 @@ function C.linearPipeline(t,modulename)
__linearpipelinecnt = __linearpipelinecnt+1
end
err(type(t)=="table" and J.keycount(t)==#t, "C.linearPipeline: input must be array")
for _,v in ipairs(t) do err(R.isFunction(v), "C.linearPipeline: input must be table of Rigel modules") end
local inp = R.input(t[1].inputType)
local out = inp
View
@@ -84,6 +84,7 @@ function harnessTop(t)
if backend==nil then backend = "verilog" end
local outDir = t.outDir
if outDir==nil then outDir=os.getenv("BUILDDIR") end
if outDir==nil then outDir= "out" end
-- if user explicitly passes us the the info, just trust them...
View
@@ -0,0 +1,29 @@
local R = require "rigel"
local C = require "examplescommon"
return function(fn,t)
if R.isFunction(fn)==false then
fn = C.linearPipeline(fn,"Top")
end
local backend
if t~=nil then backend = t.backend end
if backend==nil then backend = arg[1] end
if backend==nil then backend = "verilog" end
local filename = string.gsub(arg[0],".lua","") --arg[0]
print("FILENAME",filename)
if backend=="verilog" or backend=="verilator" then
io.output("out/"..filename..".v")
io.write(fn:toVerilog())
io.output():close()
elseif backend=="metadata" then
local f = io.open("out/"..filename..".metadata.lua","w")
f:write( "return {inputFiles={'"..fn.globalMetadata.MAXI0_read_filename.."'},outputFiles={'"..fn.globalMetadata.MAXI0_write_filename.."'},topModule='"..fn.name.."'}" )
f:close()
else
print("backend",backend)
assert(false)
end
end
View

Large diffs are not rendered by default.

Oops, something went wrong.
View
@@ -0,0 +1,9 @@
local R = require "rigel"
local SOC = require "soc"
local C = require "examplescommon"
local harness = require "harnessLL"
local RS = require "rigelSimple"
require "types".export()
print(i,u,b)
harness{SOC.axiBurstReadN("frame_128.raw",(128*64)/8,0), RS.HS(C.cast(b(64),u(64))), RS.HS(C.plus100(u(64))), RS.HS(C.cast(u(64),b(64))), SOC.axiBurstWriteN("out/soc_simple",(128*64)/8,0)}
View
@@ -9,5 +9,9 @@ if arg[2]=="INPUT_FILES" then
end
print(str)
else
print(metadata[arg[2]])
end
if type(metadata[arg[2]])=="table" then
print(table.concat(metadata[arg[2]]," "))
else
print(metadata[arg[2]])
end
end
Oops, something went wrong.

0 comments on commit 295cab5

Please sign in to comment.