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

[Darjeeling] Configure Darjeeling clocks #25990

Merged
merged 2 commits into from
Jan 23, 2025
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/ip_templates/clkmgr/data/clkmgr.hjson.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -601,7 +601,7 @@
bits: "${min_msb}:${max_msb+1}",
name: "LO",
desc: "Min threshold for ${src} measurement",
resval: "${ratio - 10}"
resval: "${max(ratio - 10, 0)}"
},
]
},
Expand Down
12 changes: 6 additions & 6 deletions hw/top_darjeeling/data/autogen/top_darjeeling.gen.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,25 @@
{
name: main
aon: no
freq: "100000000"
freq: "1000000000"
ref: false
}
{
name: io
aon: no
freq: "96000000"
freq: "1000000000"
ref: false
}
{
name: usb
aon: no
freq: "48000000"
freq: "1000000000"
ref: false
}
{
name: aon
aon: yes
freq: "200000"
freq: "62500000"
ref: true
}
]
Expand All @@ -65,15 +65,15 @@
{
name: io_div2
aon: no
freq: "48000000"
freq: "500000000"
ref: false
div: "2"
src: io
}
{
name: io_div4
aon: no
freq: "24000000"
freq: "250000000"
ref: false
div: "4"
src: io
Expand Down
12 changes: 6 additions & 6 deletions hw/top_darjeeling/data/top_darjeeling.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@
// freq: Absolute frequency of clk in Hz
// ref: indicates the clock is used as a reference for measurement.
srcs: [
{ name: "main", aon: "no", freq: "100000000" }
{ name: "io", aon: "no", freq: "96000000" }
{ name: "usb", aon: "no", freq: "48000000" }
{ name: "aon", aon: "yes", freq: "200000", ref: true}
{ name: "main", aon: "no", freq: "1000000000" }
{ name: "io", aon: "no", freq: "1000000000" }
{ name: "usb", aon: "no", freq: "1000000000" }
{ name: "aon", aon: "yes", freq: "62500000", ref: true}
],

// Derived clock source attributes
Expand All @@ -71,8 +71,8 @@
// src: From which clock source is the clock derived
// div: Ratio between derived clock and source clock
derived_srcs: [
{ name: "io_div2", aon: "no", div: 2, src: "io", freq: "48000000" }
{ name: "io_div4", aon: "no", div: 4, src: "io", freq: "24000000" }
{ name: "io_div2", aon: "no", div: 2, src: "io", freq: "500000000" }
{ name: "io_div4", aon: "no", div: 4, src: "io", freq: "250000000" }
],

// Clock Group attributes
Expand Down
6 changes: 3 additions & 3 deletions hw/top_darjeeling/dv/autogen/tb__xbar_connect.sv
Original file line number Diff line number Diff line change
Expand Up @@ -234,11 +234,11 @@ initial begin
xbar_clk_rst_if.wait_for_reset(.wait_posedge(1'b0));

clk_rst_if_main.set_active(.drive_rst_n_val(0));
clk_rst_if_main.set_freq_khz(100000000 / 1000);
clk_rst_if_main.set_freq_khz(1000000000 / 1000);
clk_rst_if_usb.set_active(.drive_rst_n_val(0));
clk_rst_if_usb.set_freq_khz(48000000 / 1000);
clk_rst_if_usb.set_freq_khz(1000000000 / 1000);
clk_rst_if_io_div4.set_active(.drive_rst_n_val(0));
clk_rst_if_io_div4.set_freq_khz(24000000 / 1000);
clk_rst_if_io_div4.set_freq_khz(250000000 / 1000);

end
end
Expand Down
24 changes: 12 additions & 12 deletions hw/top_darjeeling/ip_autogen/clkmgr/data/clkmgr.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -644,17 +644,17 @@
storage_err_alert: "fatal_fault",
fields: [
{
bits: "7:0",
bits: "3:0",
name: "HI",
desc: "Max threshold for io_div4 measurement",
resval: "130"
resval: "14"
},

{
bits: "15:8",
bits: "7:4",
name: "LO",
desc: "Min threshold for io_div4 measurement",
resval: "110"
resval: "0"
},
]
},
Expand Down Expand Up @@ -698,17 +698,17 @@
storage_err_alert: "fatal_fault",
fields: [
{
bits: "9:0",
bits: "5:0",
name: "HI",
desc: "Max threshold for main measurement",
resval: "510"
resval: "26"
},

{
bits: "19:10",
bits: "11:6",
name: "LO",
desc: "Min threshold for main measurement",
resval: "490"
resval: "6"
},
]
},
Expand Down Expand Up @@ -752,17 +752,17 @@
storage_err_alert: "fatal_fault",
fields: [
{
bits: "8:0",
bits: "5:0",
name: "HI",
desc: "Max threshold for usb measurement",
resval: "250"
resval: "26"
},

{
bits: "17:9",
bits: "11:6",
name: "LO",
desc: "Min threshold for usb measurement",
resval: "230"
resval: "6"
},
]
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@
{
name: main
aon: false
freq: 100000000
freq: 1000000000
ref: false
}
io:
{
name: io
aon: false
freq: 96000000
freq: 1000000000
ref: false
}
usb:
{
name: usb
aon: false
freq: 48000000
freq: 1000000000
ref: false
}
aon:
{
name: aon
aon: true
freq: 200000
freq: 62500000
ref: true
}
}
Expand All @@ -42,29 +42,29 @@
{
name: io_div2
aon: false
freq: 48000000
freq: 500000000
ref: false
div: 2
src:
{
name: io
aon: no
freq: "96000000"
freq: "1000000000"
ref: false
}
}
io_div4:
{
name: io_div4
aon: false
freq: 24000000
freq: 250000000
ref: false
div: 4
src:
{
name: io
aon: no
freq: "96000000"
freq: "1000000000"
ref: false
}
}
Expand Down
36 changes: 18 additions & 18 deletions hw/top_darjeeling/ip_autogen/clkmgr/doc/registers.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,21 +279,21 @@ Configuration controls for io_div4 measurement.
The threshold fields are made wider than required (by 1 bit) to ensure
there is room to adjust for measurement inaccuracies.
- Offset: `0x2c`
- Reset default: `0x6e82`
- Reset mask: `0xffff`
- Reset default: `0xe`
- Reset mask: `0xff`
- Register enable: [`MEASURE_CTRL_REGWEN`](#measure_ctrl_regwen)

### Fields

```wavejson
{"reg": [{"name": "HI", "bits": 8, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 8, "attr": ["rw"], "rotate": 0}, {"bits": 16}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
{"reg": [{"name": "HI", "bits": 4, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 4, "attr": ["rw"], "rotate": 0}, {"bits": 24}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
```

| Bits | Type | Reset | Name | Description |
|:------:|:------:|:-------:|:-------|:--------------------------------------|
| 31:16 | | | | Reserved |
| 15:8 | rw | 0x6e | LO | Min threshold for io_div4 measurement |
| 7:0 | rw | 0x82 | HI | Max threshold for io_div4 measurement |
| 31:8 | | | | Reserved |
| 7:4 | rw | 0x0 | LO | Min threshold for io_div4 measurement |
| 3:0 | rw | 0xe | HI | Max threshold for io_div4 measurement |

## MAIN_MEAS_CTRL_EN
Enable for measurement control
Expand All @@ -319,21 +319,21 @@ Configuration controls for main measurement.
The threshold fields are made wider than required (by 1 bit) to ensure
there is room to adjust for measurement inaccuracies.
- Offset: `0x34`
- Reset default: `0x7a9fe`
- Reset mask: `0xfffff`
- Reset default: `0x19a`
- Reset mask: `0xfff`
- Register enable: [`MEASURE_CTRL_REGWEN`](#measure_ctrl_regwen)

### Fields

```wavejson
{"reg": [{"name": "HI", "bits": 10, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 10, "attr": ["rw"], "rotate": 0}, {"bits": 12}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
{"reg": [{"name": "HI", "bits": 6, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 6, "attr": ["rw"], "rotate": 0}, {"bits": 20}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
```

| Bits | Type | Reset | Name | Description |
|:------:|:------:|:-------:|:-------|:-----------------------------------|
| 31:20 | | | | Reserved |
| 19:10 | rw | 0x1ea | LO | Min threshold for main measurement |
| 9:0 | rw | 0x1fe | HI | Max threshold for main measurement |
| 31:12 | | | | Reserved |
| 11:6 | rw | 0x6 | LO | Min threshold for main measurement |
| 5:0 | rw | 0x1a | HI | Max threshold for main measurement |

## USB_MEAS_CTRL_EN
Enable for measurement control
Expand All @@ -359,21 +359,21 @@ Configuration controls for usb measurement.
The threshold fields are made wider than required (by 1 bit) to ensure
there is room to adjust for measurement inaccuracies.
- Offset: `0x3c`
- Reset default: `0x1ccfa`
- Reset mask: `0x3ffff`
- Reset default: `0x19a`
- Reset mask: `0xfff`
- Register enable: [`MEASURE_CTRL_REGWEN`](#measure_ctrl_regwen)

### Fields

```wavejson
{"reg": [{"name": "HI", "bits": 9, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 9, "attr": ["rw"], "rotate": 0}, {"bits": 14}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
{"reg": [{"name": "HI", "bits": 6, "attr": ["rw"], "rotate": 0}, {"name": "LO", "bits": 6, "attr": ["rw"], "rotate": 0}, {"bits": 20}], "config": {"lanes": 1, "fontsize": 10, "vspace": 80}}
```

| Bits | Type | Reset | Name | Description |
|:------:|:------:|:-------:|:-------|:----------------------------------|
| 31:18 | | | | Reserved |
| 17:9 | rw | 0xe6 | LO | Min threshold for usb measurement |
| 8:0 | rw | 0xfa | HI | Max threshold for usb measurement |
| 31:12 | | | | Reserved |
| 11:6 | rw | 0x6 | LO | Min threshold for usb measurement |
| 5:0 | rw | 0x1a | HI | Max threshold for usb measurement |

## RECOV_ERR_CODE
Recoverable Error code
Expand Down
6 changes: 3 additions & 3 deletions hw/top_darjeeling/ip_autogen/clkmgr/rtl/clkmgr.sv
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,7 @@
end

clkmgr_meas_chk #(
.Cnt(240),
.Cnt(8),
.RefCnt(1)
) u_io_div4_meas (
.clk_i,
Expand All @@ -576,7 +576,7 @@


clkmgr_meas_chk #(
.Cnt(1000),
.Cnt(32),
.RefCnt(1)
) u_main_meas (
.clk_i,
Expand All @@ -603,7 +603,7 @@


clkmgr_meas_chk #(
.Cnt(480),
.Cnt(32),
.RefCnt(1)
) u_usb_meas (
.clk_i,
Expand Down
Loading
Loading