Skip to content

Commit c8da061

Browse files
Renaming of CTP things
1 parent f6fb42a commit c8da061

File tree

14 files changed

+139
-122
lines changed

14 files changed

+139
-122
lines changed

arch/csr/misa.yaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -137,17 +137,17 @@ fields:
137137
return (implemented?(ExtensionName::M) && MUTABLE_MISA_M) ? CsrFieldType::RW : CsrFieldType::RO;
138138
definedBy: M
139139
reset_value: 1
140-
cert-coverage-points:
141-
- id: csr.misa.M.disabled
140+
cert_coverage_points:
141+
- id: csr_field.misa.M.disabled
142142
name: Disabling `misa.M` bit
143143
description: What happens when you turn off `misa.M`
144144
doc_links:
145145
- manual:csr:misa:disabling-extension
146-
cert-test-procedures:
146+
cert_test_procedures:
147147
- id: csr.misa.M.muldiv_with_M_on&off
148148
name: Testing M
149149
description: Execute with M on/off
150-
coverage-points: [csr.misa.M.disabled]
150+
coverage_points: [csr_field.misa.M.disabled]
151151
steps:
152152
- name: on
153153
description: Turn on `misa.M`
@@ -208,17 +208,17 @@ sw_read(): |
208208
(CSR[misa].C << 2) |
209209
(CSR[misa].B << 1) |
210210
CSR[misa].A);
211-
cert-coverage-points:
211+
cert_coverage_points:
212212
- id: csr.misa.disabling_bits
213213
name: Disabling `misa` bits
214214
description: What happens when you turn off bits
215215
doc_links:
216216
- manual:csr:misa:disabling-extension
217-
cert-test-procedures:
217+
cert_test_procedures:
218218
- id: csr.misa.off&on
219219
name: Testing bits
220220
description: Turn on/off each bit and see what happens
221-
coverage-points: [csr.misa.disabling_bits]
221+
coverage_points: [csr.misa.disabling_bits]
222222
steps:
223223
- name: setup
224224
description: Turn on all bits

arch/ext/Xmock.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ params:
154154
type: boolean
155155
maxItems: 8
156156
minItems: 8
157-
cert-coverage-points:
157+
cert_coverage_points:
158158
- id: ext.Xmock.cov1
159159
name: Mock coverage point 1
160160
description: Let's have fun with the `Xmock` extension
@@ -166,11 +166,11 @@ cert-coverage-points:
166166
description: And some more fun!
167167
doc_links:
168168
- manual:csr:misa:disabling-extension
169-
cert-test-procedures:
169+
cert_test_procedures:
170170
- id: ext.Xmock.my_first
171171
name: My first procedure
172172
description: Verify that when it rains in Spain, it rains mainly on the plains!
173-
coverage-points: [ext.Xmock.cov1, ext.Xmock.cov2]
173+
coverage_points: [ext.Xmock.cov1, ext.Xmock.cov2]
174174
steps:
175175
- name: wait for rain
176176
description: First we need some rain

arch/inst/M/mul.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ sail(): |
7070
}
7171
}
7272
73-
cert-coverage-points:
73+
cert_coverage_points:
7474
- id: inst.mul.encoding
7575
name: Encoding
7676
description: Encoding of `mul` instruction
@@ -89,11 +89,11 @@ cert-coverage-points:
8989
doc_links:
9090
- manual:csr:misa:disabling-extension
9191

92-
cert-test-procedures:
92+
cert_test_procedures:
9393
- id: inst.mul.encoding
9494
name: Encoding
9595
description: Verify the encoding of the `mul` instruction
96-
coverage-points: [inst.mul.encoding]
96+
coverage_points: [inst.mul.encoding]
9797
steps:
9898
- name: setup
9999
description: Load a variety of known values into rs1 & rs2 with a variety of rs1/rs2/rd values.

arch/inst/mock.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ sail(): |
6161
}
6262
}
6363
64-
cert-coverage-points:
64+
cert_coverage_points:
6565
- id: inst.mock.encoding&basic_op
6666
name: Encoding and basic operation
6767
description: Encoding and basic operation for `mock` instruction
@@ -77,11 +77,11 @@ cert-coverage-points:
7777
- manual:csr:misa:disabling-extension
7878
# - idl:code:inst:mock:illegal-inst-exc-misa-disabled
7979

80-
cert-test-procedures:
80+
cert_test_procedures:
8181
- id: inst.mock.enc_and_basic
8282
name: Encoding
8383
description: Verify the encoding and basic operation of the `mock` instruction
84-
coverage-points: [inst.mock.encoding&basic_op]
84+
coverage_points: [inst.mock.encoding&basic_op]
8585
steps:
8686
- name: setup
8787
description: Load a variety of known values into rs1 & rs2 with a variety of rs1/rs2/rd values.

backends/portfolio/templates/coverage_points.adoc.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Coverage Points for `<%= nice_name %>`: ::
1111
| ID | Name | Description | Documentation Links
1212

1313
<% db_obj.cert_coverage_points.each do |cp| -%>
14-
| <%= defined?(org) ? anchor_for_udb_cert_cov_pt(org, cp.id) : "" %><%= cp.id %>
14+
| <%= defined?(org) ? anchor_for_udb_doc_cov_pt(org, cp.id) : "" %><%= cp.id %>
1515
| <%= cp.name %>
1616
| <%= cp.description %>
1717
a| <% cp.doc_links.each do |link| -%>

backends/portfolio/templates/test_procedures.adoc.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Test Procedures for `<%= nice_name %>`: ::
1616
| *Coverage Points*
1717
a|
1818
<% tp.cert_coverage_points.each do |cp| -%>
19-
* <%= defined?(org) ? link_to_udb_cert_cov_pt(org, cp.id) : cp.id %>
19+
* <%= defined?(org) ? link_to_udb_doc_cov_pt(org, cp.id) : cp.id %>
2020
<% end # each cp -%>
2121
| *Steps*
2222
a|

lib/arch_obj_models/database_obj.rb

Lines changed: 36 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ def cert_coverage_points
5252
return @cert_coverage_points unless @cert_coverage_points.nil?
5353

5454
@cert_coverage_points = []
55-
@data["cert-coverage-points"]&.each do |cert_data|
55+
@data["cert_coverage_points"]&.each do |cert_data|
5656
@cert_coverage_points << CertCoveragePoint.new(cert_data, self)
5757
end
5858
@cert_coverage_points
@@ -81,7 +81,7 @@ def cert_test_procedures
8181
return @cert_test_procedures unless @cert_test_procedures.nil?
8282

8383
@cert_test_procedures = []
84-
@data["cert-test-procedures"]&.each do |cert_data|
84+
@data["cert_test_procedures"]&.each do |cert_data|
8585
@cert_test_procedures << CertTestProcedure.new(cert_data, self)
8686
end
8787
@cert_test_procedures
@@ -778,8 +778,8 @@ def doc_links
778778
return @doc_links unless @doc_links.nil?
779779

780780
@doc_links = []
781-
@data["doc_links"]&.each do |link_data|
782-
@doc_links << DocLink.new(link_data, @db_obj)
781+
@data["doc_links"]&.each do |dst|
782+
@doc_links << DocLink.new(dst, @db_obj)
783783
end
784784

785785
raise "Missing doc_links for certification coverage point ID '#{id}' of kind #{@db_obj.kind}" if @doc_links.empty?
@@ -788,30 +788,46 @@ def doc_links
788788
end
789789
end
790790

791-
# Used to create links into RISC-V documentation with the following formats:
792-
# ISA manuals manual:ext:<ext-name>:<id>
793-
# manual:inst:<inst-name>:<id>
794-
# manual:csr:<csr-name>:<id>
795-
# manual:csr:<csr-name>:<id>
796-
# non-ISA system component standards, UDB generated documentation,
797-
# and regions of Sail/IDL pseudo-code.
798-
#
791+
# Creates links into RISC-V documentation with the following formats for the destination link:
799792
#
793+
# Documenation Format
794+
# ============ ===============================================================
795+
# ISA manuals manual:ext:<ext_name>:<location>
796+
# manual:inst:<inst_name>:<location>
797+
# manual:csr:<csr_name>:<location>
798+
# manual:csr_field:<csr_name>:<field_name>:<location>
799+
# manual:param:<ext_name>:<param_name>:<location>
800+
# where <location> is the location within the ISA manual documentation
801+
# UDB doc udb:doc:ext:<ext_name>
802+
# udb:doc:ext_param:<ext_name>:<param_name>
803+
# udb:doc:inst:<inst_name>
804+
# udb:doc:csr:<csr_name>
805+
# udb:doc:csr_field:<csr_name>:<field_name>
806+
# udb:doc:func:<func_name> (Documentation of common/built-in IDL functions)
807+
# udb:doc:cov_pt:<org>:<id>
808+
# where <org> is:
809+
# sep for UDB documentation that "separates" coverage points from test plans
810+
# combo for UDB documentation that "combines" coverage points with test plans
811+
# appendix for UDB documentation that has coverage points and test plans in appendices
812+
# where <id> is the ID of the coverage point
813+
# IDL code idl:code:inst:<inst-name>:<location>
814+
# TODO for CSR and CSR Fields
800815
class DocLink
801-
# @param data [String] The documentation link provided in the YAML
802-
def initialize(data, db_obj)
803-
raise ArgumentError, "Need String but was passed a #{data.class}" unless data.is_a?(String)
804-
@id = data
816+
# @param dst_link [String] The documentation link provided in the YAML
817+
# @param db_obj [String] Database object
818+
def initialize(dst_link, db_obj)
819+
raise ArgumentError, "Need String but was passed a #{data.class}" unless dst_link.is_a?(String)
820+
@dst_link = dst_link
805821

806-
raise ArgumentError, "Missing documentation link for #{db_obj.name} of kind #{db_obj.kind}" if @id.nil?
822+
raise ArgumentError, "Missing documentation link for #{db_obj.name} of kind #{db_obj.kind}" if @dst_link.nil?
807823
end
808824

809825
# @return [String] Unique ID of the linked to coverage point
810-
def id = @id
826+
def dst_link = @dst_link
811827

812828
# @return [String] Asciidoc to create desired link.
813829
def to_adoc
814-
"<<#{@id},#{@id}>>"
830+
"<<#{@dst_link},#{@dst_link}>>"
815831
end
816832
end
817833

@@ -844,7 +860,7 @@ def cert_coverage_points
844860
return @cert_coverage_points unless @cert_coverage_points.nil?
845861

846862
@cert_coverage_points = []
847-
@data["coverage-points"]&.each do |id|
863+
@data["coverage_points"]&.each do |id|
848864
cp = @db_obj.cert_coverage_point(id)
849865
raise ArgumentError, "Can't find certification test procedure with ID '#{id}' for '#{@db_obj.name}' of kind #{@db_obj.kind}" if cp.nil?
850866
@cert_coverage_points << cp

lib/backend_helpers.rb

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -87,21 +87,21 @@ def link_to_udb_doc_idl_func(func_name)
8787
"%%UDB_DOC_LINK%func;#{func_name.sanitize};#{func_name}%%"
8888
end
8989

90-
# @return [String] A hyperlink into IDL instruction code
91-
# @param func_name [String] Name of the instruction
92-
# @param func_name [String] Name of the location within the instruction code
93-
def link_into_idl_inst_code(inst_name, loc_name)
94-
"%%IDL_CODE_LINK%inst;#{inst_name.sanitize}.#{loc_name.sanitize};#{inst_name}.#{loc_name}%%"
95-
end
96-
# TODO: Add csr and csr_field support
97-
9890
# @return [String] A hyperlink to a UDB certification coverage point (separate chapters for cov pts and test procs)
9991
# @param org [String] Organization of coverage points and test procedures (sep=separate chapters, combo=combined chapters, appendix=appendix)
10092
# @param id [String] ID of the coverage point
101-
def link_to_udb_cert_cov_pt(org, id)
93+
def link_to_udb_doc_cov_pt(org, id)
10294
raise ArgumentError, "Unknown org value of '#{org}' for ID '#{id}'" unless org == "sep" || org == "combo" || org == "appendix"
103-
"%%UDB_CERT_COV_PT_LINK%#{org};#{id.sanitize};#{id}%%"
95+
"%%UDB_DOC_COV_PT_LINK%#{org};#{id.sanitize};#{id}%%"
96+
end
97+
98+
# @return [String] A hyperlink into IDL instruction code
99+
# @param func_name [String] Name of the instruction
100+
# @param id [String] ID within the instruction code
101+
def link_into_idl_inst_code(inst_name, id)
102+
"%%IDL_CODE_LINK%inst;#{inst_name.sanitize}.#{id.sanitize};#{inst_name}.#{id}%%"
104103
end
104+
# TODO: Add csr and csr_field support
105105

106106
###########
107107
# ANCHORS #
@@ -146,23 +146,23 @@ def anchor_for_udb_doc_idl_func(name)
146146
"[#udb:doc:func:#{name.sanitize}]"
147147
end
148148

149-
# @return [String] An anchor inside IDL instruction code
150-
# @param func_name [String] Name of the instruction
151-
# @param func_name [String] Name of the location within the instruction code
152-
def anchor_inside_idl_inst_code(inst_name, loc_name)
153-
"[#idl:code:inst:#{inst_name.sanitize}:#{loc_name.sanitize}]"
154-
end
155-
# TODO: Add csr and csr_field support
156-
157-
# @return [String] An anchor for a UDB certification coverage point (separate chapters for cov pts and test procs)
158-
# @param org [String] Organization of coverage points and test procedures (sep=separate chapters, combo=combined chapters, appendix=appendix)
149+
# @return [String] An anchor for a UDB coverage point documentation
150+
# @param org [String] Document organization of coverage points and test procedures (sep=separate chapters, combo=combined chapters, appendix=appendix)
159151
# @param id [String] ID of the coverage point
160152
# Have to use [[anchor]] instead of [#anchor] since only the former works when in a table cell.
161-
def anchor_for_udb_cert_cov_pt(org, id)
153+
def anchor_for_udb_doc_cov_pt(org, id)
162154
raise ArgumentError, "Unknown org value of '#{org}' for ID '#{id}'" unless org == "sep" || org == "combo" || org == "appendix"
163-
"[[udb:cert:cov_pt:#{org}:#{id.sanitize}]]"
155+
"[[udb:doc:cov_pt:#{org}:#{id.sanitize}]]"
164156
end
165157

158+
# @return [String] An anchor inside IDL instruction code
159+
# @param func_name [String] Name of the instruction
160+
# @param id [String] ID within the instruction code
161+
def anchor_inside_idl_inst_code(inst_name, id)
162+
"[#idl:code:inst:#{inst_name.sanitize}:#{id.sanitize}]"
163+
end
164+
# TODO: Add csr and csr_field support
165+
166166
private
167167
#@ param s [String]
168168
def check_no_periods(s)
@@ -213,27 +213,27 @@ def resolve_links(path_or_str)
213213
else
214214
raise "Unhandled link type of '#{type}' for '#{name}' with link_text '#{link_text}'"
215215
end
216+
end.gsub(/%%UDB_DOC_COV_PT_LINK%([^;%]+)\s*;\s*([^;%]+)\s*;\s*([^%]+)%%/) do
217+
org = Regexp.last_match[1] # "sep", "combo", or "appendix"
218+
id = Regexp.last_match[2]
219+
link_text = Regexp.last_match[3]
220+
221+
raise "Unhandled link org of '#{org}' for ID '#{id}' with link_text '#{link_text}'" unless org == "sep" || org == "combo" || org == "appendix"
222+
223+
"<<udb:doc:cov_pt:#{org}:#{id},#{link_text}>>"
216224
end.gsub(/%%IDL_CODE_LINK%([^;%]+)\s*;\s*([^;%]+)\s*;\s*([^%]+)%%/) do
217225
type = Regexp.last_match[1]
218226
name = Regexp.last_match[2]
219227
link_text = Regexp.last_match[3]
220228

221229
case type
222230
when "inst"
223-
inst_name, loc_name = name.split('.')
224-
"<<idl:code:inst:#{inst_name}:#{loc_name},#{link_text}>>"
231+
inst_name, id = name.split('.')
232+
"<<idl:code:inst:#{inst_name}:#{id},#{link_text}>>"
225233
# TODO: Add csr and csr_field support
226234
else
227235
raise "Unhandled link type of '#{type}' for '#{name}' with link_text '#{link_text}'"
228236
end
229-
end.gsub(/%%UDB_CERT_COV_PT_LINK%([^;%]+)\s*;\s*([^;%]+)\s*;\s*([^%]+)%%/) do
230-
org = Regexp.last_match[1] # sep or combo
231-
id = Regexp.last_match[2]
232-
link_text = Regexp.last_match[3]
233-
234-
raise "Unhandled link org of '#{org}' for ID '#{id}' with link_text '#{link_text}'" unless org == "sep" || org == "combo" || org == "appendix"
235-
236-
"<<udb:cert:cov_pt:#{org}:#{id},#{link_text}>>"
237237
end
238238
end
239239
end
@@ -276,17 +276,17 @@ def resolve_links(path_or_str)
276276

277277
case type
278278
when "ext"
279-
"xref:exts:#{name}.adoc#udb:doc:ext:#{name}[#{link_text.gsub(']', '\]')}]"
279+
"xref:exts:#{name}.adoc#udb:doc:ext:#{name}[#{link_text}]"
280280
when "ext_param"
281281
ext_name, param_name = name.split('.')
282-
"xref:exts:#{ext_name}.adoc#udb:doc:ext_param:#{ext_name}:#{param_name}[#{link_text.gsub(']', '\]')}]"
282+
"xref:exts:#{ext_name}.adoc#udb:doc:ext_param:#{ext_name}:#{param_name}[#{link_text}]"
283283
when "inst"
284-
"xref:insts:#{name}.adoc#udb:doc:inst:#{name}[#{link_text.gsub(']', '\]')}]"
284+
"xref:insts:#{name}.adoc#udb:doc:inst:#{name}[#{link_text}]"
285285
when "csr"
286-
"xref:csrs:#{name}.adoc#udb:doc:csr:#{name}[#{link_text.gsub(']', '\]')}]"
286+
"xref:csrs:#{name}.adoc#udb:doc:csr:#{name}[#{link_text}]"
287287
when "csr_field"
288288
csr_name, field_name = name.split('.')
289-
"xref:csrs:#{csr_name}.adoc#udb:doc:csr_field:#{csr_name}:#{field_name}[#{link_text.gsub(']', '\]')}]"
289+
"xref:csrs:#{csr_name}.adoc#udb:doc:csr_field:#{csr_name}:#{field_name}[#{link_text}]"
290290
when "func"
291291
# All functions are in the same file called "funcs.adoc".
292292
"xref:funcs:funcs.adoc#udb:doc:func:#{name}[#{link_text.gsub(']', '\]')}]"
@@ -300,8 +300,8 @@ def resolve_links(path_or_str)
300300

301301
case type
302302
when "inst"
303-
inst_name, loc_name = name.split('.')
304-
"xref:insts:#{inst_name}.adoc#idl:code:inst:#{inst_name}:#{loc_name}[#{link_text.gsub(']', '\]')}]"
303+
inst_name, id = name.split('.')
304+
"xref:insts:#{inst_name}.adoc#idl:code:inst:#{inst_name}:#{id}[#{link_text}]"
305305
# TODO: Add csr and csr_field support
306306
else
307307
raise "Unhandled link type of '#{type}' for '#{name}' with link_text '#{link_text}'"

0 commit comments

Comments
 (0)