Skip to content

Commit

Permalink
Add functions to add dram streams and interfaces
Browse files Browse the repository at this point in the history
  • Loading branch information
paul-g committed Sep 11, 2015
1 parent bb7e613 commit 4000c18
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/com/custom_computing_ic/dfe_snippets/manager/ManagerUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,19 @@ public static EngineInterface interfaceWrite(String name, String fromCpuStream,
return ei;
}

public static EngineInterface dramWrite(CustomManager m) {
m.addStreamToOnCardMemory("cpu2lmem", MemoryControlGroup.MemoryAccessPattern.LINEAR_1D) <== m.addStreamFromCPU("fromcpu");
EngineInterface ei = new EngineInterface("dramWrite");
CPUTypes TYPE = CPUTypes.INT;
InterfaceParam size = ei.addParam("size_bytes", TYPE);
InterfaceParam start = ei.addParam("start_bytes", TYPE);
ei.setStream("fromcpu", CPUTypes.UINT8, size);
ei.setLMemLinear("cpu2lmem", start, size);
ei.ignoreAll(Direction.IN_OUT);
return ei;
}


// A generic DRAM read interface
public static EngineInterface interfaceRead(String name, String toCpuStream, String lmem2cpuStream) {
EngineInterface ei = new EngineInterface(name);
Expand All @@ -87,6 +100,18 @@ public static EngineInterface interfaceRead(String name, String toCpuStream, Str
return ei;
}

public static EngineInterface dramRead(CustomManager m) {
m.addStreamToCPU("tocpu") <== m.addStreamFromOnCardMemory("lmem2cpu", MemoryControlGroup.MemoryAccessPattern.LINEAR_1D);
EngineInterface ei = new EngineInterface("dramRead");
CPUTypes TYPE = CPUTypes.INT;
InterfaceParam size = ei.addParam("size_bytes", TYPE);
InterfaceParam start = ei.addParam("start_bytes", TYPE);
ei.setStream("tocpu", CPUTypes.UINT8, size);
ei.setLMemLinear("lmem2cpu", start, size);
ei.ignoreAll(Direction.IN_OUT);
return ei;
}

// Enable debugging with Stream Status for the given manager
public static void debug(CustomManager manager) {
DebugLevel dbgLevel = new DebugLevel();
Expand Down

0 comments on commit 4000c18

Please sign in to comment.