Skip to content
Permalink
Browse files

afu descriptor handling

  • Loading branch information...
KennethWilke
KennethWilke committed Feb 19, 2016
1 parent 3ee450b commit 21a012c31a63eca5802fda52db13b31508fb40a8
Showing with 53 additions and 1 deletion.
  1. +1 −0 .gitignore
  2. +33 −0 capi.sv
  3. +19 −1 mmio.sv
@@ -12,3 +12,4 @@ top.done
top.flow.rpt
top.map.rpt
top.map.summary
top.qws
33 capi.sv
@@ -114,4 +114,37 @@ package CAPI;
bit data_parity;
} MMIOInterfaceOutput;

typedef struct packed {
bit [0:15] num_ints_per_process;
bit [0:15] num_of_processes;
bit [0:15] num_of_afu_crs;
bit [0:15] req_prog_model;
bit [0:199] reserved_1;
bit [0:55] afu_cr_len;
bit [0:63] afu_cr_offset;
bit [0:5] reserved_2;
bit psa_per_process_required;
bit psa_required;
bit [0:55] psa_length;
bit [0:63] psa_offset;
bit [0:7] reserved_3;
bit [0:55] afu_eb_len;
bit [0:63] afu_eb_offset;
} AFUDescriptor;

function bit [0:63] read_afu_descriptor(AFUDescriptor descriptor,
bit [0:23] address);
case(address)
'h0: begin
return {descriptor.num_ints_per_process,
descriptor.num_of_processes,
descriptor.num_of_afu_crs,
descriptor.req_prog_model};
end
default: begin
return 0;
end
endcase
endfunction

endpackage
20 mmio.sv
@@ -7,6 +7,7 @@ module mmio (

logic ack;
logic [0:63] data;
AFUDescriptor afu_desc;

shift_register ack_shift(
.clock(clock),
@@ -18,6 +19,23 @@ module mmio (
.in(data),
.out(mmio_out.data));

// Set our AFU Descriptor values
assign afu_desc.num_ints_per_process = 0,
afu_desc.num_of_processes = 1,
afu_desc.num_of_afu_crs = 0,
afu_desc.req_prog_model = 16'h8010,
afu_desc.reserved_1 = 0,
afu_desc.afu_cr_len = 0,
afu_desc.afu_cr_offset = 0,
afu_desc.reserved_2 = 0,
afu_desc.psa_per_process_required = 0,
afu_desc.psa_required = 0,
afu_desc.psa_length = 0,
afu_desc.psa_offset = 0,
afu_desc.reserved_3 = 0,
afu_desc.afu_eb_len = 0,
afu_desc.afu_eb_offset = 0;

// Set parity bit for MMIO output
assign mmio_out.data_parity = ~^mmio_out.data;

@@ -26,7 +44,7 @@ module mmio (
if(mmio_in.cfg) begin
if(mmio_in.read) begin
ack <= 1;
data <= 1;
data <= read_afu_descriptor(afu_desc, mmio_in.address);
end
end
end else begin

0 comments on commit 21a012c

Please sign in to comment.
You can’t perform that action at this time.