Skip to content

Commit

Permalink
Merge pull request #4 from ayosher/ayosher/xqciuv0p3
Browse files Browse the repository at this point in the history
Add Xqciu v0.3, renamed it to Xqci
  • Loading branch information
dhower-qc authored Oct 14, 2024
2 parents de3c63f + 2c20ae5 commit 119192d
Show file tree
Hide file tree
Showing 179 changed files with 1,201 additions and 1,100 deletions.
5 changes: 4 additions & 1 deletion backends/arch_gen/lib/arch_gen.rb
Original file line number Diff line number Diff line change
Expand Up @@ -702,7 +702,10 @@ def maybe_add_ext(ext_name)

merged_path = gen_merged_def(:ext, arch_path, arch_overlay_path)

ext_obj = YAML.load_file(merged_path)[ext_name]
yaml_contents = YAML.load_file(merged_path)
raise "In #{merged_path}, key does not match file name" unless yaml_contents.key?(ext_name)

ext_obj = yaml_contents[ext_name]
ext_obj["name"] = ext_name

@implied_ext_map ||= {}
Expand Down
14 changes: 11 additions & 3 deletions backends/ext_pdf_doc/templates/ext_pdf.adoc.erb
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ Copyright <%= ext_version["ratification_date"].nil? ? Date.today.year : ext_vers
Contributors to version <%= version["version"] %> of the specification (in alphabetical order) include: +

<%- version["contributors"].sort { |a, b| a["name"].split(" ").last <=> b["name"].split(" ").last }.each do |c| -%>
* <%= c["name"] %> <<%= c["email"] %>> (<%= c["company"] %>)
* <%= c["name"] %> <<%= c["email"] %>> (<%= c["company"] %>)

<%- end -%>
<%- end -%>

Expand Down Expand Up @@ -419,8 +420,14 @@ RV64::
Description::
<%= i.description %>


Decode Variables::

<%- if i.multi_encoding? ? (i.decode_variables(32).empty? && i.decode_variables(64).empty?) : i.decode_variables(i.base.nil? ? 64 : i.base).empty? -%>

<%= i.name %> has no decode variables.

<%- else -%>
<%- if i.multi_encoding? -%>
RV32::
+
Expand All @@ -446,7 +453,8 @@ RV64::
<%= d.sext? ? 'signed ' : '' %>Bits<<%= d.size %>> <%= d.name %> = <%= d.extract %>;
<%- end -%>
----
<%- end -%>
<%- end # if multi_encoding? -%>
<%- end # if no decode variables-%>
Operation::
[source,idl,subs="specialchars,macros"]
Expand Down Expand Up @@ -491,4 +499,4 @@ h| Arguments l| <%= f.arguments_list_str.join (', ') %>
----
<%- end -%>
<%- end -%>
<%- end -%>
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
pend_template = <<~YAML
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json
mclicip<%= num %>:
qc.mclicip<%= num %>:
long_name: IRQ Pending <%= num %>
address: 0x<%= (0x7f0 + num).to_s(16) %>
length: 32
priv_mode: M
definedBy: Xqciu
definedBy: Xqci
description: |
Pending bits for IRQs <%= num*32 %>-<%= (num + 1)*32 - 1 %>
fields:
Expand All @@ -18,19 +18,19 @@
type: RW
reset_value: 0
location: <%= i %>
description: IRQ<%= num*32 + 1 %> pending
description: IRQ<%= num*32 + i %> pending
<%- end -%>
YAML

en_template = <<~YAML
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json
mclicie<%= num %>:
qc.mclicie<%= num %>:
long_name: IRQ Enable <%= num %>
address: 0x<%= (0x7f0 + num).to_s(16) %>
length: 32
priv_mode: M
definedBy: Xqciu
definedBy: Xqci
description: |
Enable bits for IRQs <%= num*32 %>-<%= (num + 1)*32 - 1 %>
fields:
Expand All @@ -39,18 +39,18 @@
type: RW
reset_value: 0
location: <%= i %>
description: IRQ<%= num*32 + 1 %> enabled
description: IRQ<%= num*32 + i %> enabled
<%- end -%>
YAML

root = File.dirname(__FILE__)

erb = ERB.new(pend_template, trim_mode: '-')
8.times do |num|
File.write("#{root}/mclicip#{num}.yaml", erb.result(binding))
File.write("#{root}/qc.mclicip#{num}.yaml", erb.result(binding))
end

erb = ERB.new(en_template, trim_mode: '-')
8.times do |num|
File.write("#{root}/mclicie#{num}.yaml", erb.result(binding))
File.write("#{root}/qc.mclicie#{num}.yaml", erb.result(binding))
end
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# yaml-language-server: $schema=../../../../../schemas/csr_schema.json

mclicie0:
qc.mclicie0:
long_name: IRQ Enable 0
address: 0x7f0
length: 32
priv_mode: M
definedBy: Xqciu
definedBy: Xqci
description: |
Enable bits for IRQs 0-31
fields:
IRQ0:
type: RW
reset_value: 0
location: 0
description: IRQ1 enabled
description: IRQ0 enabled
IRQ1:
type: RW
reset_value: 0
Expand All @@ -23,149 +23,149 @@ mclicie0:
type: RW
reset_value: 0
location: 2
description: IRQ1 enabled
description: IRQ2 enabled
IRQ3:
type: RW
reset_value: 0
location: 3
description: IRQ1 enabled
description: IRQ3 enabled
IRQ4:
type: RW
reset_value: 0
location: 4
description: IRQ1 enabled
description: IRQ4 enabled
IRQ5:
type: RW
reset_value: 0
location: 5
description: IRQ1 enabled
description: IRQ5 enabled
IRQ6:
type: RW
reset_value: 0
location: 6
description: IRQ1 enabled
description: IRQ6 enabled
IRQ7:
type: RW
reset_value: 0
location: 7
description: IRQ1 enabled
description: IRQ7 enabled
IRQ8:
type: RW
reset_value: 0
location: 8
description: IRQ1 enabled
description: IRQ8 enabled
IRQ9:
type: RW
reset_value: 0
location: 9
description: IRQ1 enabled
description: IRQ9 enabled
IRQ10:
type: RW
reset_value: 0
location: 10
description: IRQ1 enabled
description: IRQ10 enabled
IRQ11:
type: RW
reset_value: 0
location: 11
description: IRQ1 enabled
description: IRQ11 enabled
IRQ12:
type: RW
reset_value: 0
location: 12
description: IRQ1 enabled
description: IRQ12 enabled
IRQ13:
type: RW
reset_value: 0
location: 13
description: IRQ1 enabled
description: IRQ13 enabled
IRQ14:
type: RW
reset_value: 0
location: 14
description: IRQ1 enabled
description: IRQ14 enabled
IRQ15:
type: RW
reset_value: 0
location: 15
description: IRQ1 enabled
description: IRQ15 enabled
IRQ16:
type: RW
reset_value: 0
location: 16
description: IRQ1 enabled
description: IRQ16 enabled
IRQ17:
type: RW
reset_value: 0
location: 17
description: IRQ1 enabled
description: IRQ17 enabled
IRQ18:
type: RW
reset_value: 0
location: 18
description: IRQ1 enabled
description: IRQ18 enabled
IRQ19:
type: RW
reset_value: 0
location: 19
description: IRQ1 enabled
description: IRQ19 enabled
IRQ20:
type: RW
reset_value: 0
location: 20
description: IRQ1 enabled
description: IRQ20 enabled
IRQ21:
type: RW
reset_value: 0
location: 21
description: IRQ1 enabled
description: IRQ21 enabled
IRQ22:
type: RW
reset_value: 0
location: 22
description: IRQ1 enabled
description: IRQ22 enabled
IRQ23:
type: RW
reset_value: 0
location: 23
description: IRQ1 enabled
description: IRQ23 enabled
IRQ24:
type: RW
reset_value: 0
location: 24
description: IRQ1 enabled
description: IRQ24 enabled
IRQ25:
type: RW
reset_value: 0
location: 25
description: IRQ1 enabled
description: IRQ25 enabled
IRQ26:
type: RW
reset_value: 0
location: 26
description: IRQ1 enabled
description: IRQ26 enabled
IRQ27:
type: RW
reset_value: 0
location: 27
description: IRQ1 enabled
description: IRQ27 enabled
IRQ28:
type: RW
reset_value: 0
location: 28
description: IRQ1 enabled
description: IRQ28 enabled
IRQ29:
type: RW
reset_value: 0
location: 29
description: IRQ1 enabled
description: IRQ29 enabled
IRQ30:
type: RW
reset_value: 0
location: 30
description: IRQ1 enabled
description: IRQ30 enabled
IRQ31:
type: RW
reset_value: 0
location: 31
description: IRQ1 enabled
description: IRQ31 enabled
Loading

0 comments on commit 119192d

Please sign in to comment.