Skip to content

Commit

Permalink
Add return value register internal to PULP cluster.
Browse files Browse the repository at this point in the history
  • Loading branch information
Yvan Tortorella committed Oct 19, 2023
1 parent b38a18b commit d1475ae
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
2 changes: 1 addition & 1 deletion Bender.lock
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ packages:
dependencies:
- common_cells
cluster_peripherals:
revision: a596f17fc77713909bceb7eecf3ea2c3cdfe707c
revision: c015839816938a790c8da5fd5829cfc536f1ca9c
version: null
source:
Git: https://github.com/pulp-platform/cluster_peripherals.git
Expand Down
2 changes: 1 addition & 1 deletion Bender.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ dependencies:
mchan: { git: "https://github.com/pulp-platform/mchan.git", rev: 7f064f205a3e0203e959b14773c4afecf56681ab } # branch: yt/fix-parametrization
idma: { git: "https://github.com/pulp-platform/iDMA.git", rev: 437ffa9dac5dea0daccfd3e8ae604d4f6ae2cdf1 } # branch: master
hier-icache: { git: "https://github.com/pulp-platform/hier-icache.git", rev: "a971e364bf8090cf77fafad995b480c1ac7ea4e0" } # branch: yt/carfield
cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", rev: a596f17fc77713909bceb7eecf3ea2c3cdfe707c } # branch: yt/bump-hci
cluster_peripherals: { git: "https://github.com/pulp-platform/cluster_peripherals.git", rev: c015839816938a790c8da5fd5829cfc536f1ca9c } # branch: yt/return-reg
# fpu_interco: { git: "https://github.com/pulp-platform/fpu_interco.git", rev: "4aec4b68424947b0c4cf25fd7c4b907cb9ec3dfa" } # branch: yt/carfield
axi: { git: "https://github.com/pulp-platform/axi.git", version: =0.39.1-beta }
axi_slice: { git: "https://github.com/pulp-platform/axi_slice.git", version: 1.1.4 } # deprecated, replaced by axi_cut (in axi repo)
Expand Down
34 changes: 17 additions & 17 deletions tb/pulp_cluster_tb.sv
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ module pulp_cluster_tb;
localparam bit[AxiAw-1:0] L2BaseAddr = 'h78000000;
localparam bit[AxiAw-1:0] L2Size = 'h10000000;
localparam bit[AxiAw-1:0] BootAddr = L2BaseAddr + 'h8080;
localparam bit[AxiAw-1:0] ClustReturnInt = 'h50200100;

typedef logic [AxiAw-1:0] axi_addr_t;
typedef logic [AxiDw-1:0] axi_data_t;
Expand Down Expand Up @@ -502,27 +503,26 @@ module pulp_cluster_tb;
end

@(negedge s_clk);
assign s_cluster_en_sa_boot = 1'b1;
assign s_cluster_en_sa_boot = 1'b1;
@(negedge s_clk);
assign s_cluster_fetch_en = 1'b1;
assign s_cluster_fetch_en = 1'b1;

ret_val = '0;
while(~s_cluster_eoc) begin

ar_beat.ax_addr = 32'h1A10_40A0;
ar_beat.ax_len = '0;
ar_beat.ax_burst = axi_pkg::BURST_INCR;
ar_beat.ax_size = 4'h2;

axi_master_drv.send_ar(ar_beat);
@(posedge s_clk);
axi_master_drv.recv_r(r_beat);
ret_val = r_beat.r_data;
repeat(1000)
@(posedge s_clk);

repeat(1)
@(posedge s_clk);
end


ar_beat.ax_addr = ClustReturnInt;
ar_beat.ax_len = '0;
ar_beat.ax_burst = axi_pkg::BURST_INCR;
ar_beat.ax_size = 4'h2;

axi_master_drv.send_ar(ar_beat);
@(posedge s_clk);
axi_master_drv.recv_r(r_beat);
ret_val = r_beat.r_data;

$display("[TB] Received ret_val: %d\n", ret_val[30:0]);

if(ret_val[30:0]==0) begin
Expand All @@ -531,7 +531,7 @@ module pulp_cluster_tb;
end else begin
$fatal(1,"[TB] Test not passed: ret_val!=0\n");
end

end


Expand Down

0 comments on commit d1475ae

Please sign in to comment.