Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
[submodule "aws"]
path = piton/design/aws
url = https://github.com/PrincetonUniversity/openpiton-aws.git
[submodule "piton/design/chip/tile/warp_v/submodule"]
path = piton/design/chip/tile/warp_v/submodule
url = https://github.com/shivampotdar/warp-v.git
3 changes: 2 additions & 1 deletion piton/ariane_build_tools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@
# default-jdk \
# zlib1g-dev \
# valgrind \
# csh
# csh \
# device-tree-compiler


echo
Expand Down
13 changes: 7 additions & 6 deletions piton/ariane_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ echo

echo "make sure that you source this script in a bash shell in the root folder of OpenPiton"

if [ "$0" != "bash" ] && [ "$0" != "-bash" ]
then
echo "not in bash ($0), aborting"
return
# if [ "$0" != "bash" ] && [ "$0" != "-bash" ]
# then
# echo "not in bash ($0), aborting"
# return

fi
# fi

SCRIPTNAME=ariane_setup.sh

Expand All @@ -76,7 +76,8 @@ export ARIANE_ROOT=${PITON_ROOT}/piton/design/chip/tile/ariane/
## GCC and RISCV GCC setup
export CXX=g++ CC=gcc
# customize this to a fast local disk
export RISCV=/scratch/`whoami`/riscv_install
#export RISCV=/scratch/`whoami`/riscv_install
export RISCV=/mnt/Shivam/SelfLearning/Projects/2020.2_GSoC/openpiton/riscv-openpiton/
export VERILATOR_ROOT=$ARIANE_ROOT/tmp/verilator-4.014/

# setup paths
Expand Down
2 changes: 2 additions & 0 deletions piton/design/chip/rtl/chip.v.pyv
Original file line number Diff line number Diff line change
Expand Up @@ -1120,6 +1120,8 @@ module chip(
currenttype = "`PICORV32_TILE"
elif (PITON_ARIANE):
currenttype = "`ARIANE_RV64_TILE"
elif (PITON_WARPV):
currenttype = "`WARPV_TILE"
else:
currenttype = "`SPARC_TILE"

Expand Down
2 changes: 1 addition & 1 deletion piton/design/chip/tile/ariane
45 changes: 45 additions & 0 deletions piton/design/chip/tile/rtl/tile.v.pyv
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,51 @@ print(str)
`endif // ifdef PITON_ARIANE
end
endgenerate
generate
if (TILE_TYPE == `WARPV_TILE) begin : g_warpv_core
`ifdef PITON_WARPV
///////////////////
// WARPV Core //
///////////////////
wire warpv_int;

warpv_openpiton core(
.clk (clk_gated),
.reset_op_in (rst_n_f),
.l15_transducer_ack (l15_transducer_ack),
.l15_transducer_header_ack (l15_transducer_header_ack),
.transducer_l15_rqtype (transducer_l15_rqtype),
.transducer_l15_amo_op (transducer_l15_amo_op),
.transducer_l15_size (transducer_l15_size),
.transducer_l15_val (transducer_l15_val),
.transducer_l15_address (transducer_l15_address),
.transducer_l15_data (transducer_l15_data),
.transducer_l15_nc (transducer_l15_nc),
.transducer_l15_threadid (transducer_l15_threadid),
.transducer_l15_prefetch (transducer_l15_prefetch),
.transducer_l15_invalidate_cacheline (transducer_l15_invalidate_cacheline),
.transducer_l15_blockstore (transducer_l15_blockstore),
.transducer_l15_blockinitstore (transducer_l15_blockinitstore),
.transducer_l15_l1rplway (transducer_l15_l1rplway),
.transducer_l15_data_next_entry (transducer_l15_data_next_entry),
.transducer_l15_csm_data (transducer_l15_csm_data),
.l15_transducer_val (l15_transducer_val),
.l15_transducer_returntype (l15_transducer_returntype),
.l15_transducer_data_0 (l15_transducer_data_0),
.l15_transducer_data_1 (l15_transducer_data_1),
.transducer_l15_req_ack (transducer_l15_req_ack),
.warpv_int (warpv_int)
);

warpv_reset warpv_reset(
.gclk(clk_gated),
.rst_n(rst_n_f),
.spc_grst_l(spc_grst_l)
);

`endif // ifdef PITON_WARPV
end
endgenerate


//////////
Expand Down
23 changes: 23 additions & 0 deletions piton/design/chip/tile/warp_v/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Makefile for WARP-V with OpenPiton

SHELL=/bin/bash

export PATH:=$(shell pwd)/env/bin:$(PATH)

.PHONY: all clean compile

# Run SandPiper Cloud Edition(TM) (SandPiper(TM) in the cloud for open-source code).
out/warp-v_openpiton.sv: warp-v_openpiton.tlv ./submodule/warp-v.tlv
rm -rf rtl/spout
curl -F 'top.tlv=@warp-v_openpiton.tlv' -F 'files[]=@./submodule/warp-v.tlv' http://saas.makerchip.com/sandpiper | tar -zx && cat out/stdout
mv out rtl/spout
sed -i 's/wire\( \[[^\[]\+\] L1_Mem_Value_\)/reg\1/' ./rtl/spout/warp-v_openpiton.sv
sed -i 's/wire\( \[[^\[]\+\] FETCH_Instr_Regs_value_\)/reg\1/' ./rtl/spout/warp-v_openpiton_gen.sv
exit `cat ./rtl/spout/status`

compile: .rtl/spout/warp-v_openpiton.sv

all: compile

clean:
rm -rf rtl/spout
1 change: 1 addition & 0 deletions piton/design/chip/tile/warp_v/rtl/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
spout/
4 changes: 4 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/Flist.warpv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
spout/warp-v_openpiton.sv
warpv_reset.v
+incdir+include/
+incdir+spout/
38 changes: 38 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/clk_gate.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
/*
Copyright (c) 2014, Steven F. Hoover

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of Steven F. Hoover
may not be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Clock gate module used by SandPiper default project.

// Note: No X injection for X on free_clk.)
module clk_gate (output logic gated_clk, input logic free_clk, func_en, pwr_en, gating_override);
logic clk_en;
logic latched_clk_en /*verilator clock_enable*/;
always_comb clk_en = func_en & (pwr_en | gating_override);
always_latch if (~free_clk) latched_clk_en <= clk_en;
// latched_clk_en <= (~free_clk) ? clk_en : latched_clk_en;
always_comb gated_clk = latched_clk_en & free_clk;
endmodule
69 changes: 69 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/pseudo_rand.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
//_\TLV_version 1b: tl-x.org, generated by SandPiper(TM) 1.9-2018/02/11-beta
`include "sp_default.vh" //_\SV
/*
Copyright (c) 2014, Steven F. Hoover

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of Steven F. Hoover
may not be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

module pseudo_rand
#(parameter WIDTH=257) // Random vector width, to a max of 257.
(input logic clk,
input logic reset,
output logic [WIDTH-1:0] rand_vect
);

// Currently, this implements a Galois LFSR.
// TODO: It should be XORed with something else so it doesn't just shift.
// Using polynomials with maximal number of taps would have less regular shifting behavior.

// Bits are numbered in the reverse of the traditional order. This puts the taps in the lower bit positions.

// Choose optimal parameters for given WIDTH.
localparam LFSR_WIDTH =
(WIDTH <= 64) ? 64 :
(WIDTH <= 128) ? 128 :
(WIDTH <= 257) ? 257 : 0; // 257 enables a large non-power of two for replication on an irregular boundary.
// Polynomial source: http://www.eej.ulst.ac.uk/~ian/modules/EEE515/files/old_files/lfsr/lfsr_table.pdf
localparam [LFSR_WIDTH-1:0] LFSR_POLY = {{(LFSR_WIDTH-8){1'b0}},
(LFSR_WIDTH == 64) ? 8'b00011011 :
(LFSR_WIDTH == 128) ? 8'b10000111 :
(LFSR_WIDTH == 257) ? 8'b11000101 : 8'b0};

bit [256:0] SEED = 257'h0_7163e168_713d5431_6684e132_5cd84848_f3048b46_76874654_0c45f864_04e4684a;



`include "pseudo_rand_gen.sv" //_\TLV
//_|default
//_@0
assign DEFAULT_reset_a0 = reset;
//_@1
assign DEFAULT_lfsr_a1[LFSR_WIDTH-1:0] = DEFAULT_reset_a1 ? SEED : {DEFAULT_lfsr_a2[LFSR_WIDTH-2:0], 1'b0} ^ ({LFSR_WIDTH{DEFAULT_lfsr_a2[LFSR_WIDTH-1]}} & LFSR_POLY);
//_@2
assign rand_vect = DEFAULT_lfsr_a2[WIDTH-1:0]; endgenerate

//_\SV

endmodule
47 changes: 47 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/pseudo_rand_gen.sv
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
// Generated by SandPiper(TM) 1.9-2018/02/11-beta from Redwood EDA.
// (Installed here: /home/steve/mono/sandpiper/distro.)
// Redwood EDA does not claim intellectual property rights to this file and provides no warranty regarding its correctness or quality.


`include "sandpiper_gen.vh"





//
// Signals declared top-level.
//

// For |default$lfsr.
logic [LFSR_WIDTH-1:0] DEFAULT_lfsr_a1,
DEFAULT_lfsr_a2;

// For |default$reset.
logic DEFAULT_reset_a0,
DEFAULT_reset_a1;



generate


//
// Scope: |default
//

// For $lfsr.
always_ff @(posedge clk) DEFAULT_lfsr_a2[LFSR_WIDTH-1:0] <= DEFAULT_lfsr_a1[LFSR_WIDTH-1:0];

// For $reset.
always_ff @(posedge clk) DEFAULT_reset_a1 <= DEFAULT_reset_a0;




endgenerate




generate // This is awkward, but we need to go into 'generate' context in the line that `includes the declarations file.
71 changes: 71 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/sandpiper.vh
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/*
Copyright (c) 2015, Steven F. Hoover

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

* Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
* The name of Steven F. Hoover
may not be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

// Project-independent SandPiper header file.

`ifndef SANDPIPER_VH
`define SANDPIPER_VH


// Note, these have no SP prefix, so collisions are possible.


`ifdef WHEN
// Make sure user definition does not collide.
!!!ERROR: WHEN macro already defined
`else
`ifdef SP_PHYS
// Phys compilation disabled X-injection.
`define WHEN(valid_sig)
`else
// Inject X.
`define WHEN(valid_sig) !valid_sig ? 'x :
`endif
`endif


// SandPiper does not generate set/reset flops. Reset is implemented as combinational
// logic, and it is up to synthesis to infer set/reset flops when possible.
//`ifdef RESET
// // Make sure user definition does not collide.
// !!!ERROR: RESET macro already defined
//`else
// `define RESET(i, reset) ((reset) ? '0 : i)
//`endif
//
//`ifdef SET
// // Make sure user definition does not collide.
// !!!ERROR: SET macro already defined
//`else
// `define SET(i, set) ((set) ? '1 : i)
//`endif

// Since SandPiper required use of all signals, this is useful to create a
// bogus use and keep SandPiper happy when a signal, by intent, has no uses.
`define BOGUS_USE(ignore)

`endif // SANDPIPER_VH
4 changes: 4 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/sandpiper_gen.vh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
// This just verifies that sandpiper.vh has been included.
`ifndef SANDPIPER_VH
!!!ERROR: SandPiper project's sp_<proj>.vh file must include sandpiper.vh.
`endif
8 changes: 8 additions & 0 deletions piton/design/chip/tile/warp_v/rtl/include/sp_default.vh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
`ifndef SP_DEFAULT
`define SP_DEFAULT

// File included by SandPiper-generated code for the default project configuration.
`include "sandpiper.vh"


`endif // SP_DEFAULT
Loading