Skip to content

Commit 5fa7d1c

Browse files
Filip.GhermanFilipG24
authored andcommitted
library/axi_hsci: Add HSCI IP core
Signed-off-by: Filip Gherman <filip.gherman@analog.com>
1 parent 1b965f5 commit 5fa7d1c

17 files changed

+4958
-0
lines changed

library/axi_hsci/Makefile

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
####################################################################################
2+
## Copyright (c) 2018 - 2025 Analog Devices, Inc.
3+
### SPDX short identifier: BSD-1-Clause
4+
## Auto-generated, do not modify!
5+
####################################################################################
6+
7+
LIBRARY_NAME := axi_hsci
8+
9+
GENERIC_DEPS += ../common/ad_rst.v
10+
GENERIC_DEPS += axi4_lite.sv
11+
GENERIC_DEPS += axi_hsci.sv
12+
GENERIC_DEPS += hsci_master_axi_slave.sv
13+
GENERIC_DEPS += hsci_master_logic.sv
14+
GENERIC_DEPS += hsci_master_regs_defs.vh
15+
GENERIC_DEPS += hsci_master_regs_regs.sv
16+
GENERIC_DEPS += hsci_master_top.sv
17+
GENERIC_DEPS += hsci_mcore.v
18+
GENERIC_DEPS += hsci_mdec.sv
19+
GENERIC_DEPS += hsci_menc.sv
20+
GENERIC_DEPS += hsci_mfrm_det.v
21+
GENERIC_DEPS += hsci_mlink_ctrl.sv
22+
GENERIC_DEPS += lfsr15_8.v
23+
GENERIC_DEPS += pulse_sync.v
24+
25+
XILINX_DEPS += ../xilinx/common/ad_rst_constr.xdc
26+
XILINX_DEPS += axi_hsci_ip.tcl
27+
28+
include ../scripts/library.mk

library/axi_hsci/axi4_lite.sv

Lines changed: 83 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,83 @@
1+
// ***************************************************************************
2+
// ***************************************************************************
3+
// Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
4+
//
5+
// In this HDL repository, there are many different and unique modules, consisting
6+
// of various HDL (Verilog or VHDL) components. The individual modules are
7+
// developed independently, and may be accompanied by separate and unique license
8+
// terms.
9+
//
10+
// The user should read each of these license terms, and understand the
11+
// freedoms and responsibilities that he or she has by using this source/core.
12+
//
13+
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
14+
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15+
// A PARTICULAR PURPOSE.
16+
//
17+
// Redistribution and use of source or resulting binaries, with or without modification
18+
// of this file, are permitted under one of the following two license terms:
19+
//
20+
// 1. The GNU General Public License version 2 as published by the
21+
// Free Software Foundation, which can be found in the top level directory
22+
// of this repository (LICENSE_GPL2), and also online at:
23+
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
24+
//
25+
// OR
26+
//
27+
// 2. An ADI specific BSD license, which can be found in the top level directory
28+
// of this repository (LICENSE_ADIBSD), and also on-line at:
29+
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
30+
// This will allow to generate bit files and not release the source code,
31+
// as long as it attaches to an ADI device.
32+
//
33+
// ***************************************************************************
34+
// ***************************************************************************
35+
36+
`timescale 1ns/1ns
37+
interface axi4_lite #(
38+
DATA_WIDTH = 32,
39+
ADDR_WIDTH = 32
40+
);
41+
42+
localparam WSTRB_WIDTH = DATA_WIDTH/8;
43+
44+
// Write address channel
45+
logic awvalid;
46+
logic awready;
47+
logic [2:0] awprot;
48+
logic [ADDR_WIDTH-1:0] awaddr;
49+
50+
// Write data channel
51+
logic wvalid;
52+
logic wready;
53+
logic [WSTRB_WIDTH-1:0] wstrb;
54+
logic [DATA_WIDTH-1:0] wdata;
55+
56+
// Write response channel
57+
logic bvalid;
58+
logic bready;
59+
logic [1:0] bresp;
60+
61+
// Read address channel
62+
logic arvalid;
63+
logic arready;
64+
logic [2:0] arprot;
65+
logic [ADDR_WIDTH-1:0] araddr;
66+
67+
// Read response channel
68+
logic rvalid;
69+
logic rready;
70+
logic [1:0] rresp;
71+
logic [DATA_WIDTH-1:0] rdata;
72+
73+
modport master (
74+
output awvalid, awprot, awaddr, wvalid, wstrb, wdata, bready, arvalid, arprot, araddr, rready,
75+
input awready, wready, bvalid, bresp, arready, rvalid, rresp, rdata
76+
);
77+
78+
modport slave (
79+
output awready, wready, bvalid, bresp, arready, rvalid, rresp, rdata,
80+
input awvalid, awprot, awaddr, wvalid, wstrb, wdata, bready, arvalid, arprot, araddr, rready
81+
);
82+
83+
endinterface

library/axi_hsci/axi_hsci.sv

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
// ***************************************************************************
2+
// ***************************************************************************
3+
// Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
4+
//
5+
// In this HDL repository, there are many different and unique modules, consisting
6+
// of various HDL (Verilog or VHDL) components. The individual modules are
7+
// developed independently, and may be accompanied by separate and unique license
8+
// terms.
9+
//
10+
// The user should read each of these license terms, and understand the
11+
// freedoms and responsibilities that he or she has by using this source/core.
12+
//
13+
// This core is distributed in the hope that it will be useful, but WITHOUT ANY
14+
// WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
15+
// A PARTICULAR PURPOSE.
16+
//
17+
// Redistribution and use of source or resulting binaries, with or without modification
18+
// of this file, are permitted under one of the following two license terms:
19+
//
20+
// 1. The GNU General Public License version 2 as published by the
21+
// Free Software Foundation, which can be found in the top level directory
22+
// of this repository (LICENSE_GPL2), and also online at:
23+
// <https://www.gnu.org/licenses/old-licenses/gpl-2.0.html>
24+
//
25+
// OR
26+
//
27+
// 2. An ADI specific BSD license, which can be found in the top level directory
28+
// of this repository (LICENSE_ADIBSD), and also on-line at:
29+
// https://github.com/analogdevicesinc/hdl/blob/main/LICENSE_ADIBSD
30+
// This will allow to generate bit files and not release the source code,
31+
// as long as it attaches to an ADI device.
32+
//
33+
// ***************************************************************************
34+
// ***************************************************************************
35+
36+
`timescale 1ps/1ps
37+
import hsci_master_regs_pkg::*;
38+
39+
module axi_hsci #(
40+
parameter AXI_ADDR_WIDTH = 15,
41+
parameter AXI_DATA_WIDTH = 32,
42+
parameter REGMAP_ADDR_WIDTH = 16,
43+
parameter S_AXI_ADDR_WIDTH = 18
44+
) (
45+
input wire s_axi_aclk,
46+
input wire s_axi_aresetn,
47+
48+
input wire [S_AXI_ADDR_WIDTH-1:0] s_axi_awaddr,
49+
input wire [2:0] s_axi_awprot,
50+
input wire s_axi_awvalid,
51+
input wire s_axi_bready,
52+
input wire [AXI_DATA_WIDTH-1:0] s_axi_wdata,
53+
input wire s_axi_wvalid,
54+
input wire s_axi_rready,
55+
input wire [(AXI_DATA_WIDTH/8)-1 : 0] s_axi_wstrb,
56+
input wire [S_AXI_ADDR_WIDTH-1:0] s_axi_araddr,
57+
input wire [2:0] s_axi_arprot,
58+
input wire s_axi_arvalid,
59+
60+
output wire s_axi_wready,
61+
output wire s_axi_arready,
62+
output wire [1:0] s_axi_rresp,
63+
output wire [AXI_DATA_WIDTH-1:0] s_axi_rdata,
64+
output wire s_axi_rvalid,
65+
output wire s_axi_awready,
66+
output wire [1:0] s_axi_bresp,
67+
output wire s_axi_bvalid,
68+
69+
input wire hsci_pclk,
70+
output [7:0] hsci_menc_clk,
71+
output [7:0] hsci_mosi_data,
72+
input wire [7:0] hsci_miso_data,
73+
74+
output wire hsci_pll_reset,
75+
input wire hsci_rst_seq_done,
76+
input wire hsci_pll_locked,
77+
input wire hsci_vtc_rdy_bsc_tx,
78+
input wire hsci_dly_rdy_bsc_tx,
79+
input wire hsci_vtc_rdy_bsc_rx,
80+
input wire hsci_dly_rdy_bsc_rx
81+
82+
);
83+
84+
axi4_lite #(32,18) axi();
85+
86+
assign axi.awaddr = s_axi_awaddr;
87+
assign axi.awprot = s_axi_awprot;
88+
assign axi.awvalid = s_axi_awvalid;
89+
assign axi.bready = s_axi_bready;
90+
assign axi.wdata = s_axi_wdata;
91+
assign axi.wvalid = s_axi_wvalid;
92+
assign axi.rready = s_axi_rready;
93+
assign axi.wstrb = s_axi_wstrb;
94+
assign axi.araddr = s_axi_araddr;
95+
assign axi.arprot = s_axi_arprot;
96+
assign axi.arvalid = s_axi_arvalid;
97+
98+
assign s_axi_wready = axi.wready;
99+
assign s_axi_arready = axi.arready;
100+
assign s_axi_rresp = axi.rresp;
101+
assign s_axi_rdata = axi.rdata;
102+
assign s_axi_rvalid = axi.rvalid ;
103+
assign s_axi_awready = axi.awready;
104+
assign s_axi_bresp = axi.bresp;
105+
assign s_axi_bvalid = axi.bvalid;
106+
107+
hsci_master_top #(
108+
.AXI_ADDR_WIDTH (AXI_ADDR_WIDTH),
109+
.AXI_DATA_WIDTH (AXI_DATA_WIDTH),
110+
.REGMAP_ADDR_WIDTH (REGMAP_ADDR_WIDTH),
111+
.S_AXI_ADDR_WIDTH (S_AXI_ADDR_WIDTH)
112+
) hsci_master_top (
113+
.axi_clk (s_axi_aclk),
114+
.axi_resetn (s_axi_aresetn),
115+
.axi (axi),
116+
.hsci_pclk (hsci_pclk),
117+
.hsci_menc_clk (hsci_menc_clk),
118+
.hsci_mosi_data (hsci_mosi_data),
119+
.hsci_miso_data (hsci_miso_data),
120+
.hsci_pll_reset (hsci_pll_reset),
121+
.hsci_rst_seq_done (hsci_rst_seq_done),
122+
.hsci_pll_locked (hsci_pll_locked),
123+
.hsci_vtc_rdy_bsc_tx (hsci_vtc_rdy_bsc_tx),
124+
.hsci_dly_rdy_bsc_tx (hsci_dly_rdy_bsc_tx),
125+
.hsci_vtc_rdy_bsc_rx (hsci_vtc_rdy_bsc_rx),
126+
.hsci_dly_rdy_bsc_rx (hsci_dly_rdy_bsc_rx));
127+
128+
endmodule
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
<: set ComponentName [getComponentNameString] :>
7+
<: setOutputDirectory "./" :>
8+
<: setFileName [ttcl_add $ComponentName "_constr"] :>
9+
<: setFileExtension ".xdc" :>
10+
<: setFileProcessingOrder late :>
11+
12+
set_false_path \
13+
-from [get_cells -hierarchical * -filter {NAME=~*hsci_master_top/hsci_master_logic/hsci_master_regs_regs/O_reg[hsci_bram_start_address][data][*]/C}] \
14+
-to [get_cells -hierarchical * -filter {NAME=~*hsci_master_top/hsci_mcore/enc0/enc_addr_reg[*]/D}]
15+
16+
set_false_path \
17+
-from [get_cells -hierarchical * -filter {NAME=~*hsci_master_top/hsci_master_logic/hsci_master_regs_regs/O_reg[hsci_xfer_num][data][*]/C}] \
18+
-to [get_cells -hierarchical * -filter {NAME=~*hsci_master_top/hsci_mcore/enc0/m_xfer_num_reg[*]/D}]
19+
20+
set_false_path -from [get_cells -filter IS_SEQUENTIAL -hierarchical -regexp ".*O_reg.*"] -to [get_clocks -of_objects [get_ports {hsci_pclk}]]

library/axi_hsci/axi_hsci_ip.tcl

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
###############################################################################
2+
## Copyright (C) 2025 Analog Devices, Inc. All rights reserved.
3+
### SPDX short identifier: ADIBSD
4+
###############################################################################
5+
6+
# ip
7+
8+
source ../../scripts/adi_env.tcl
9+
source ../scripts/adi_ip_xilinx.tcl
10+
11+
adi_ip_create axi_hsci
12+
adi_ip_files axi_hsci [list \
13+
"../common/ad_rst.v" \
14+
"../xilinx/common/ad_rst_constr.xdc" \
15+
"axi_hsci.sv" \
16+
"hsci_master_axi_slave.sv" \
17+
"hsci_master_logic.sv" \
18+
"hsci_master_regs_defs.vh" \
19+
"hsci_master_regs_regs.sv" \
20+
"hsci_master_top.sv" \
21+
"hsci_mcore.v" \
22+
"hsci_mdec.sv" \
23+
"hsci_menc.sv" \
24+
"hsci_mfrm_det.v" \
25+
"hsci_mlink_ctrl.sv" \
26+
"lfsr15_8.v" \
27+
"pulse_sync.v" \
28+
"axi4_lite.sv" ]
29+
30+
adi_ip_properties axi_hsci
31+
adi_ip_ttcl axi_hsci "axi_hsci_constr.ttcl"
32+
set_property display_name "ADI AXI HSCI" [ipx::current_core]
33+
set_property description "ADI AXI HSCI" [ipx::current_core]
34+
# set_property company_url {https://wiki.analog.com/resources/fpga/docs/axi_hsci} [ipx::current_core]
35+
36+
adi_init_bd_tcl
37+
38+
proc add_reset {name polarity} {
39+
set reset_intf [ipx::infer_bus_interface $name xilinx.com:signal:reset_rtl:1.0 [ipx::current_core]]
40+
set reset_polarity [ipx::add_bus_parameter "POLARITY" $reset_intf]
41+
set_property value $polarity $reset_polarity
42+
}
43+
44+
ipx::infer_bus_interface hsci_pclk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
45+
# ipx::infer_bus_interface hsci_data_clk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
46+
ipx::infer_bus_interface s_axi_aclk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
47+
# ipx::infer_bus_interface delay_clk xilinx.com:signal:clock_rtl:1.0 [ipx::current_core]
48+
49+
add_reset s_axi_aresetn ACTIVE_LOW
50+
51+
ipx::add_bus_parameter ASSOCIATED_BUSIF [ipx::get_bus_interfaces s_axi_aclk -of_objects [ipx::current_core]]
52+
set_property value s_axi [ipx::get_bus_parameters ASSOCIATED_BUSIF -of_objects [ipx::get_bus_interfaces s_axi_aclk -of_objects [ipx::current_core]]]
53+
54+
adi_add_auto_fpga_spec_params
55+
ipx::create_xgui_files [ipx::current_core]
56+
57+
ipx::save_core [ipx::current_core]

0 commit comments

Comments
 (0)