Skip to content
Snippets Groups Projects
Unverified Commit 1793be63 authored by Abraham Gonzalez's avatar Abraham Gonzalez Committed by GitHub
Browse files

chipyard: Add conditional traceport to top-level (#382)

* ariane: Add conditional rocket chip traceport to top-level
* ariane: Add license information
parent e01da35e
No related branches found
No related tags found
No related merge requests found
BSD 3-Clause License
Copyright (c) 2017-2020, The Regents of the University of California (Regents)
All Rights Reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. 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.
3. Neither the name of the copyright holder nor the names of its
contributors may 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 HOLDER 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.
// See LICENSE.Berkeley for license details.
// Author: Abraham Gonzalez, UC Berkeley
// Date: 24.02.2020
// Description: Traced Instruction and Port (using in Rocket Chip based systems)
package traced_instr_pkg;
typedef struct packed {
logic clock;
logic reset;
logic valid;
logic [63:0] iaddr;
logic [31:0] insn;
logic [1:0] priv;
logic exception;
logic interrupt;
logic [63:0] cause;
logic [63:0] tval;
} traced_instr_t;
typedef traced_instr_t [ariane_pkg::NR_COMMIT_PORTS-1:0] trace_port_t;
endpackage
...@@ -29,6 +29,10 @@ module ariane #( ...@@ -29,6 +29,10 @@ module ariane #(
// Timer facilities // Timer facilities
input logic time_irq_i, // timer interrupt in (async) input logic time_irq_i, // timer interrupt in (async)
input logic debug_req_i, // debug request (async) input logic debug_req_i, // debug request (async)
`ifdef FIRESIM_TRACE
// firesim trace port
output traced_instr_pkg::trace_port_t trace_o,
`endif
`ifdef PITON_ARIANE `ifdef PITON_ARIANE
// L15 (memory side) // L15 (memory side)
output wt_cache_pkg::l15_req_t l15_req_o, output wt_cache_pkg::l15_req_t l15_req_o,
...@@ -661,6 +665,23 @@ module ariane #( ...@@ -661,6 +665,23 @@ module ariane #(
// ------------------- // -------------------
// Instruction Tracer // Instruction Tracer
// ------------------- // -------------------
// Instruction trace port (used for FireSim)
`ifdef FIRESIM_TRACE
for (genvar i = 0; i < NR_COMMIT_PORTS; i++) begin : gen_tp_connect
assign trace_o[i].clock = clk_i;
assign trace_o[i].reset = rst_ni;
assign trace_o[i].valid = commit_ack[i] & ~commit_instr_id_commit[i].ex.valid;
assign trace_o[i].iaddr = commit_instr_id_commit[i].pc;
assign trace_o[i].insn = commit_instr_id_commit[i].ex.tval[31:0];
assign trace_o[i].priv = priv_lvl;
assign trace_o[i].exception = commit_ack[i] & commit_instr_id_commit[i].ex.valid & ~commit_instr_id_commit[i].ex.cause[63];
assign trace_o[i].interrupt = commit_ack[i] & commit_instr_id_commit[i].ex.valid & commit_instr_id_commit[i].ex.cause[63];
assign trace_o[i].cause = commit_instr_id_commit[i].ex.cause;
assign trace_o[i].tval = commit_instr_id_commit[i].ex.tval[31:0];
end
`endif
//pragma translate_off //pragma translate_off
`ifdef PITON_ARIANE `ifdef PITON_ARIANE
localparam PC_QUEUE_DEPTH = 16; localparam PC_QUEUE_DEPTH = 16;
...@@ -799,4 +820,3 @@ module ariane #( ...@@ -799,4 +820,3 @@ module ariane #(
//pragma translate_on //pragma translate_on
endmodule // ariane endmodule // ariane
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment