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

Replace bounds decoding ascii art with bytefield diagram #526

Merged
merged 2 commits into from
Feb 7, 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
15 changes: 10 additions & 5 deletions src/cap-description.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -445,12 +445,17 @@ Reconstituting the top two bits of T:
T[MW - 1:MW - 2] = B[MW - 1:MW - 2] + LCout + LMSB
```

Decoding the bounds:
The bounds are decoded as shown in xref:top_bound_dec[xrefstyle=short] and
xref:base_bound_dec[xrefstyle=short].

.Decoding of the MXLEN+1 wide top (_t_) bound
[#top_bound_dec]
include::img/top-bound-dec.edn[]

.Decoding of the MXLEN wide base (_b_) bound
[#base_bound_dec]
include::img/base-bound-dec.edn[]

```
top: t = { {1'b0, a[MXLEN - 1:E + MW]} + ct, T[MW - 1:0], {E{1'b0}} }
base: b = { a[MXLEN - 1:E + MW] + cb, B[MW - 1:0], {E{1'b0}} }
```
The corrections c~t~ and c~b~ are calculated as as shown below using the
definitions in xref:cap_encoding_ct[xrefstyle=short] and
xref:cap_encoding_cb[xrefstyle=short].
Expand Down
16 changes: 16 additions & 0 deletions src/img/base-bound-dec.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[bytefield]
----
(defattrs :plain [:plain {:font-family "M+ 1p Fallback" :font-size 25}])
(def row-height 80)
(def row-header-fn nil)
(def left-margin 100)
(def right-margin 100)
(def boxes-per-row 32)
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "" "" "" "" "" "" "" "" "" "E" "" "" "" "" "" "" "" "" "" "E+MW" "" "" "" "" "" "" "" "" "" "" "MXLEN-1"])})

(draw-box "a[MXLEN - 1:E + MW] + cb" {:span 12})
(draw-box "B[MW - 1:0]" {:span 10})
(draw-box "0" {:span 10})

(draw-box "MXLEN" {:span 32 :borders {}})
----
16 changes: 16 additions & 0 deletions src/img/top-bound-dec.edn
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[bytefield]
----
(defattrs :plain [:plain {:font-family "M+ 1p Fallback" :font-size 25}])
(def row-height 80)
(def row-header-fn nil)
(def left-margin 100)
(def right-margin 100)
(def boxes-per-row 32)
(draw-column-headers {:height 50 :font-size 22 :labels (reverse ["0" "" "" "" "" "" "" "" "" "" "E" "" "" "" "" "" "" "" "" "" "E+MW" "" "" "" "" "" "" "" "" "" "" "MXLEN"])})

(draw-box "{1'b0, a[MXLEN - 1:E + MW]} + ct" {:span 12})
(draw-box "T[MW - 1:0]" {:span 10})
(draw-box "0" {:span 10})

(draw-box "MXLEN+1" {:span 32 :borders {}})
----
Loading