Skip to content

Commit da3a021

Browse files
v1.3.0
1 parent 85b5fea commit da3a021

File tree

7 files changed

+61
-12
lines changed

7 files changed

+61
-12
lines changed

core.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"description": "APF core template. Displays gray test screen.",
88
"author": "Developer",
99
"url": "https://github.com/open-fpga/core-template",
10-
"version": "1.2.0",
11-
"date_release": "2022-11-05"
10+
"version": "1.3.0",
11+
"date_release": "2023-03-08"
1212
},
1313
"framework": {
1414
"target_product": "Analogue Pocket",

output/bitstream.rbf_r

-516 Bytes
Binary file not shown.

src/fpga/apf/build_id.mif

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ DATA_RADIX = HEX;
99
CONTENT
1010
BEGIN
1111

12-
0E0 : 20221025;
13-
0E1 : 00195120;
14-
0E2 : 3c157f76;
12+
0E0 : 20230308;
13+
0E1 : 00210243;
14+
0E2 : 35e2f538;
1515

1616
END;

src/fpga/core/core_bridge_cmd.v

Lines changed: 39 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ input wire savestate_load_err,
7676

7777
input wire target_dataslot_read, // rising edge triggered
7878
input wire target_dataslot_write,
79+
input wire target_dataslot_getfile,
80+
input wire target_dataslot_openfile,
7981

8082
output reg target_dataslot_ack, // asserted upon command start until completion
8183
output reg target_dataslot_done, // asserted upon command finish until next command is issued
@@ -86,6 +88,10 @@ input wire [31:0] target_dataslot_slotoffset,
8688
input wire [31:0] target_dataslot_bridgeaddr,
8789
input wire [31:0] target_dataslot_length,
8890

91+
input wire [31:0] target_buffer_param_struct, // bus address of the memory region APF will fetch additional parameter struct from
92+
input wire [31:0] target_buffer_resp_struct, // bus address of the memory region APF will write its response struct to
93+
// this should be mapped by the developer, the buffer is not implemented in this file
94+
8995
input wire [9:0] datatable_addr,
9096
input wire datatable_wren,
9197
input wire [31:0] datatable_data,
@@ -153,8 +159,8 @@ localparam [3:0] ST_DONE_ERR = 'd15;
153159
// target
154160

155161
reg [31:0] target_0;
156-
reg [31:0] target_4 = 'h20;
157-
reg [31:0] target_8 = 'h40;
162+
reg [31:0] target_4 = 'h20; // target cmd parameter data at 0x20
163+
reg [31:0] target_8 = 'h40; // target cmd response data at 0x40
158164

159165
reg [31:0] target_20; // parameter data
160166
reg [31:0] target_24;
@@ -176,6 +182,8 @@ localparam [3:0] TARG_ST_WAITRESULT_DSO = 'd15;
176182
reg status_setup_done_1, status_setup_done_queue;
177183
reg target_dataslot_read_1, target_dataslot_read_queue;
178184
reg target_dataslot_write_1, target_dataslot_write_queue;
185+
reg target_dataslot_getfile_1, target_dataslot_getfile_queue;
186+
reg target_dataslot_openfile_1, target_dataslot_openfile_queue;
179187

180188

181189
initial begin
@@ -192,6 +200,8 @@ initial begin
192200
status_setup_done_queue <= 0;
193201
target_dataslot_read_queue <= 0;
194202
target_dataslot_write_queue <= 0;
203+
target_dataslot_getfile_queue <= 0;
204+
target_dataslot_openfile_queue <= 0;
195205
target_dataslot_ack <= 0;
196206
target_dataslot_done <= 0;
197207
target_dataslot_err <= 0;
@@ -204,6 +214,8 @@ always @(posedge clk) begin
204214
status_setup_done_1 <= status_setup_done;
205215
target_dataslot_read_1 <= target_dataslot_read;
206216
target_dataslot_write_1 <= target_dataslot_write;
217+
target_dataslot_getfile_1 <= target_dataslot_getfile;
218+
target_dataslot_openfile_1 <= target_dataslot_openfile;
207219

208220
if(status_setup_done & ~status_setup_done_1) begin
209221
status_setup_done_queue <= 1;
@@ -214,6 +226,12 @@ always @(posedge clk) begin
214226
if(target_dataslot_write & ~target_dataslot_write_1) begin
215227
target_dataslot_write_queue <= 1;
216228
end
229+
if(target_dataslot_getfile & ~target_dataslot_getfile_1) begin
230+
target_dataslot_getfile_queue <= 1;
231+
end
232+
if(target_dataslot_openfile & ~target_dataslot_openfile_1) begin
233+
target_dataslot_openfile_queue <= 1;
234+
end
217235

218236

219237
b_datatable_wren <= 0;
@@ -484,6 +502,24 @@ always @(posedge clk) begin
484502
target_2C <= target_dataslot_length;
485503

486504
tstate <= TARG_ST_DATASLOTOP;
505+
506+
end else if(target_dataslot_getfile_queue) begin
507+
target_dataslot_getfile_queue <= 0;
508+
target_0[15:0] <= 16'h0190;
509+
510+
target_20 <= target_dataslot_id;
511+
target_24 <= target_buffer_resp_struct; // pointer to the bram that will hold the response struct
512+
// which will contain the requested filename before command completion
513+
tstate <= TARG_ST_DATASLOTOP;
514+
515+
end else if(target_dataslot_openfile_queue) begin
516+
target_dataslot_openfile_queue <= 0;
517+
target_0[15:0] <= 16'h0192;
518+
519+
target_20 <= target_dataslot_id;
520+
target_24 <= target_buffer_param_struct; // pointer to the bram that will hold the parameter struct
521+
// which must contain the desired filename and flag/size before command execution
522+
tstate <= TARG_ST_DATASLOTOP;
487523
end
488524
end
489525
TARG_ST_READYTORUN: begin
@@ -494,6 +530,7 @@ always @(posedge clk) begin
494530
target_0[31:16] <= 16'h636D;
495531

496532
target_dataslot_done <= 0;
533+
target_dataslot_err <= 0;
497534
tstate <= TARG_ST_WAITRESULT_DSO;
498535
end
499536
TARG_ST_WAITRESULT_DSO: begin

src/fpga/core/core_top.v

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -336,8 +336,8 @@ end
336336

337337
// bridge host commands
338338
// synchronous to clk_74a
339-
wire status_boot_done = pll_core_locked;
340-
wire status_setup_done = pll_core_locked; // rising edge triggers a target command
339+
wire status_boot_done = pll_core_locked_s;
340+
wire status_setup_done = pll_core_locked_s; // rising edge triggers a target command
341341
wire status_running = reset_n; // we are running as soon as reset_n goes high
342342

343343
wire dataslot_requestread;
@@ -386,7 +386,9 @@ end
386386

387387
reg target_dataslot_read;
388388
reg target_dataslot_write;
389-
389+
reg target_dataslot_getfile; // require additional param/resp structs to be mapped
390+
reg target_dataslot_openfile; // require additional param/resp structs to be mapped
391+
390392
wire target_dataslot_ack;
391393
wire target_dataslot_done;
392394
wire [2:0] target_dataslot_err;
@@ -396,6 +398,9 @@ end
396398
reg [31:0] target_dataslot_bridgeaddr;
397399
reg [31:0] target_dataslot_length;
398400

401+
wire [31:0] target_buffer_param_struct; // to be mapped/implemented when using some Target commands
402+
wire [31:0] target_buffer_resp_struct; // to be mapped/implemented when using some Target commands
403+
399404
// bridge data slot access
400405
// synchronous to clk_74a
401406

@@ -463,7 +468,9 @@ core_bridge_cmd icb (
463468

464469
.target_dataslot_read ( target_dataslot_read ),
465470
.target_dataslot_write ( target_dataslot_write ),
466-
471+
.target_dataslot_getfile ( target_dataslot_getfile ),
472+
.target_dataslot_openfile ( target_dataslot_openfile ),
473+
467474
.target_dataslot_ack ( target_dataslot_ack ),
468475
.target_dataslot_done ( target_dataslot_done ),
469476
.target_dataslot_err ( target_dataslot_err ),
@@ -473,6 +480,9 @@ core_bridge_cmd icb (
473480
.target_dataslot_bridgeaddr ( target_dataslot_bridgeaddr ),
474481
.target_dataslot_length ( target_dataslot_length ),
475482

483+
.target_buffer_param_struct ( target_buffer_param_struct ),
484+
.target_buffer_resp_struct ( target_buffer_resp_struct ),
485+
476486
.datatable_addr ( datatable_addr ),
477487
.datatable_wren ( datatable_wren ),
478488
.datatable_data ( datatable_data ),
@@ -647,7 +657,9 @@ end
647657
wire clk_core_12288_90deg;
648658

649659
wire pll_core_locked;
650-
660+
wire pll_core_locked_s;
661+
synch_3 s01(pll_core_locked, pll_core_locked_s, clk_74a);
662+
651663
mf_pllbase mp1 (
652664
.refclk ( clk_74a ),
653665
.rst ( 0 ),

src/fpga/output_files/ap_core.rbf

-516 Bytes
Binary file not shown.

src/fpga/output_files/ap_core.sof

0 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)