Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify Obs Pin #93

Merged
merged 2 commits into from
Dec 2, 2024
Merged
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
2 changes: 1 addition & 1 deletion hw/occamy/occamy_chip.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import ${name}_pkg::*;
input logic clk_i,
input logic rst_ni,
// Obs pins
output obs_t obs_o,
output logic [${obs_pin_width-1}:0] obs_o [${nr_clusters_s1_quadrant}],
/// Peripheral clock
input logic clk_periph_i,
input logic rst_periph_ni,
Expand Down
3 changes: 2 additions & 1 deletion hw/occamy/occamy_xilinx.sv.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,8 @@ import ${name}_pkg::*;
.bootrom_rsp_i (bootrom_axi_lite_rsp),
.ext_irq_i(ext_irq_i),
// Tie-off unused ports
.chip_ctrl_req_o(),
.obs_o(),
.chip_ctrl_req_o(),
.chip_ctrl_rsp_i ('0),
.sram_cfgs_i ('0),
.*
Expand Down
37 changes: 4 additions & 33 deletions util/occamygen/occamy.py
Original file line number Diff line number Diff line change
Expand Up @@ -569,39 +569,6 @@ def get_cheader_kwargs(occamy_cfg, cluster_generators, name):
"Not all cluster base offset in the cluster cfg are equal.")
cluster_offset = cluster_offset_list[0]
cluster_addr_width = int(math.log2(cluster_offset))
# # The lut here is to provide an easy way to determine the cluster idx based on core idx
# # e.g core_per_cluster_list = [2,3]
# # core_idx lut cluster_idx
# # 0 lut[0] 0
# # 1 lut[1] 0
# # 2 lut[2] 1
# # 3 lut[3] 1
# # 4 lut[4] 1
# lut = []
# for cluster_num, num_cores in enumerate(core_per_cluster_list):
# lut.extend([cluster_num] * num_cores)
# running_sum = []
# current_sum = 0
# for core in core_per_cluster_list:
# current_sum += core
# running_sum.append(current_sum)
# cluster_baseidx = [0] + running_sum[:-1]
# # we need to define an array in c header file for each cluster like
# # #define N_CORES_PER_CLUSTER {2,3}
# # so here we need to take out the value of the core_per_cluster_list
# # and join them with commas and then finally concat with {}
# nr_cores_per_cluster = "{" + ",".join(map(str, core_per_cluster_list)) + "}"
# lut_coreidx_clusteridx = "{" + ",".join(map(str, lut)) + "}"
# cluster_baseidx = "{" + ",".join(map(str, cluster_baseidx)) + "}"
# cheader_kwargs={
# "name": name,
# "nr_quads": nr_quads,
# "nr_clusters": nr_clusters,
# "nr_cores_per_cluster": nr_cores_per_cluster,
# "lut_coreidx_clusteridx": lut_coreidx_clusteridx,
# "cluster_baseidx": cluster_baseidx,
# "nr_cores": nr_cores
# }
cheader_kwargs = {
"name": name,
"nr_quads": nr_quads,
Expand Down Expand Up @@ -658,10 +625,14 @@ def get_chip_kwargs(soc_wide_xbar, soc_axi_lite_narrow_periph_xbar, occamy_cfg,
for cluster_generator in cluster_generators]
nr_cores_quadrant = sum(core_per_cluster_list)
nr_s1_quadrants = occamy_cfg["nr_s1_quadrant"]
cluster_cfg = cluster_generators[0].cfg
chip_kwargs = {
"name": name,
"util": util,
"occamy_cfg": occamy_cfg,
"nr_clusters_s1_quadrant": len(occamy_cfg["clusters"]),
"obs_pin_width": cluster_cfg["observable_pin_width"],

"soc_wide_xbar": soc_wide_xbar,
"soc_axi_lite_narrow_periph_xbar": soc_axi_lite_narrow_periph_xbar,
"cores": nr_s1_quadrants * nr_cores_quadrant + 1
Expand Down