@@ -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