Skip to content

Commit

Permalink
Add necessary modifications for wrapping Vivado project
Browse files Browse the repository at this point in the history
  • Loading branch information
WorldofJARcraft committed Jul 26, 2024
1 parent 9f5d9c0 commit ac63d12
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
4 changes: 3 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -706,14 +706,16 @@ fpga_filter += $(addprefix $(root-dir), common/local/util/tc_sram_wrapper.sv)
src/bootrom/bootrom_$(XLEN).sv:
$(MAKE) -C corev_apu/fpga/src/bootrom BOARD=$(BOARD) XLEN=$(XLEN) bootrom_$(XLEN).sv

fpga: $(ariane_pkg) $(src) $(fpga_src) $(uart_src) $(src_flist)
fpga-source-list: $(ariane_pkg) $(src) $(fpga_src) $(uart_src) $(src_flist)
@echo "[FPGA] Generate sources"
@echo read_vhdl {$(uart_src)} > corev_apu/fpga/scripts/add_sources.tcl
@echo read_verilog -sv {$(ariane_pkg)} >> corev_apu/fpga/scripts/add_sources.tcl
@echo read_verilog -sv {$(filter-out $(fpga_filter), $(src_flist))} >> corev_apu/fpga/scripts/add_sources.tcl
@echo read_verilog -sv {$(filter-out $(fpga_filter), $(src))} >> corev_apu/fpga/scripts/add_sources.tcl
@echo read_verilog -sv {$(fpga_src)} >> corev_apu/fpga/scripts/add_sources.tcl
@echo "[FPGA] Generate Bitstream"

fpga: fpga-source-list
$(MAKE) -C corev_apu/fpga BOARD=$(BOARD) XILINX_PART=$(XILINX_PART) XILINX_BOARD=$(XILINX_BOARD) CLK_PERIOD_NS=$(CLK_PERIOD_NS)

.PHONY: fpga
Expand Down
18 changes: 14 additions & 4 deletions corev_apu/fpga/src/ariane_peripherals_xilinx.sv
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
// or agreed to in writing, software, hardware and materials distributed under
// this License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.
// specific language governi permissions and limitations under the License.

// Xilinx Peripherals

Expand All @@ -22,8 +22,9 @@ module ariane_peripherals #(
parameter bit InclSPI = 0,
parameter bit InclEthernet = 0,
parameter bit InclGPIO = 0,
parameter bit InclTimer = 1
) (
parameter bit InclTimer = 1,
parameter int ExtraIrqs = 1
)(
input logic clk_i , // Clock
input logic clk_200MHz_i ,
input logic rst_ni , // Asynchronous reset active low
Expand All @@ -33,6 +34,7 @@ module ariane_peripherals #(
AXI_BUS.Slave gpio ,
AXI_BUS.Slave ethernet ,
AXI_BUS.Slave timer ,
input logic [ExtraIrqs - 1 : 0] irq_i,
output logic [1:0] irq_o ,
// UART
input logic rx_i ,
Expand Down Expand Up @@ -67,7 +69,15 @@ module ariane_peripherals #(
logic [ariane_soc::NumSources-1:0] irq_sources;

// Unused interrupt sources
assign irq_sources[ariane_soc::NumSources-1:7] = '0;
assign irq_sources[ariane_soc::NumSources-1:7 + ExtraIrqs] = '0;
assign irq_sources[7+ExtraIrqs-1:7] = irq_i;

generate
if(ariane_soc::NumSources < ExtraIrqs + 7)
begin
$error("Too many IRQ sources!");
end
endgenerate

REG_BUS #(
.ADDR_WIDTH ( 32 ),
Expand Down

0 comments on commit ac63d12

Please sign in to comment.