cross_origen 1.1.0 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 5562897c79ebf49e9fb75bbb83787437c0ed8d3f
4
- data.tar.gz: 4e47b1a017700d51a7dd34be36120a46cf4d245a
2
+ SHA256:
3
+ metadata.gz: 9cbda922846a3192f534c1eeca9e5986e9d8ccbbffb0ecc40c3d1b4ab78ab199
4
+ data.tar.gz: 6fe704ff82b2a145cdcb53ace6c3f505f85778f45c76276f45d80bf8efb96a72
5
5
  SHA512:
6
- metadata.gz: 29cc7e80165331b890f6ee18b3a9e63b686ee022ec167891a065ef1ee80c89b5ae7316a55657d3f756c48fef1615dac52bae2f6dbe7026f5232aabf128d8f998
7
- data.tar.gz: a39363d28a53c3d9cd11869c15b0e7b2f7722bf8e0165b3227caebdc1352cc81a12e8838da87f0fdef1632ef96cdec8c8b1fb6c65e75be46604ca80fcd2c4ff8
6
+ metadata.gz: 5dc7ade444c8d342e87fadbb265a0756a703fa6043a4139692dac5b0cf93b0c27583f79d405b932597df8d81735b9e969c49404ce072acae7e3a854a7a83319c
7
+ data.tar.gz: f7e12c505f30f7ae7fdecd9e5e1bb9446c43659b9413972288b0c7ff244eec80cbe10bda6cf70d757112ed698c2f7e8b8d35d93482a248192c84673966c3af15
data/config/version.rb CHANGED
@@ -1,8 +1,7 @@
1
1
  module CrossOrigen
2
2
  MAJOR = 1
3
- MINOR = 1
3
+ MINOR = 3
4
4
  BUGFIX = 0
5
5
  DEV = nil
6
-
7
6
  VERSION = [MAJOR, MINOR, BUGFIX].join(".") + (DEV ? ".pre#{DEV}" : '')
8
7
  end
@@ -6,6 +6,9 @@ module CrossOrigen
6
6
 
7
7
  AddressBlock = Struct.new(:name, :base_address, :range, :width)
8
8
 
9
+ # Create a shorthand way to reference Origen Core's Bit ACCESS_CODES
10
+ @@access_hash = Origen::Registers::Bit.const_get(:ACCESS_CODES)
11
+
9
12
  # Import/reader that currently only supports creating registers and bit fields
10
13
  def import(file, options = {}) # rubocop:disable CyclomaticComplexity
11
14
  require 'kramdown'
@@ -57,24 +60,65 @@ module CrossOrigen
57
60
  size = fetch register.at_xpath('spirit:size'), get_text: true, to_i: true
58
61
  addr_offset = fetch register.at_xpath('spirit:addressOffset'), get_text: true, to_dec: true
59
62
  access = fetch register.at_xpath('spirit:access'), get_text: true
60
- reset_value = fetch register.at_xpath('spirit:reset/spirit:value'), get_text: true, to_dec: true
61
- reset_mask = fetch register.at_xpath('spirit:reset/spirit:mask'), get_text: true, to_dec: true
62
- if [reset_value, reset_mask].include? nil
63
- # Set default values for some register attributes
64
- reset_value, reset_mask = 0, 0
63
+ # Determine if a reset is defined for the register
64
+ if register.at_xpath('spirit:reset').nil?
65
+ # If a reset does not exist, need to set the reset_value to 0, as Origen does not (yet) have a concept
66
+ # of a register without a reset.
67
+ reset_value = 0
65
68
  else
66
- # Do a logical bitwise AND with the reset value and mask
67
- reset_value = reset_value & reset_mask
69
+ # If a reset exists, determine the reset_value (required) and reset_mask (if defined)
70
+ reset_value = fetch register.at_xpath('spirit:reset/spirit:value'), get_text: true, to_dec: true
71
+ reset_mask = fetch register.at_xpath('spirit:reset/spirit:mask'), get_text: true, to_dec: true
72
+ # Issue #8 fix - reset_mask is optional, keep reset value as imported when a mask is not defined.
73
+ # Only perform AND-ing if mask is defined. Only zero-out the reset_value if reset_value was nil.
74
+ if reset_value.nil?
75
+ # Set default for reset_value attribute if none was provided and issue a warning.
76
+ reset_value = 0
77
+ Origen.log.warning "Register #{name.upcase} was defined as having a reset, but did not have a defined reset value. This is not compliant with IP-XACT standard."
78
+ Origen.log.warning "The reset value for #{name.upcase} has been defined as 0x0 as a result."
79
+ elsif reset_mask.nil?
80
+ # If mask is undefined, leave reset_value alone.
81
+ else
82
+ # Do a logical bitwise AND with the reset value and mask
83
+ reset_value = reset_value & reset_mask
84
+ end
68
85
  end
86
+ # Future expansion: pull in HDL path as abs_path in Origen.
69
87
  addr_block_obj.reg name, addr_offset, size: size, access: access, description: reg_description(register) do |reg|
70
88
  register.xpath('spirit:field').each do |field|
71
89
  name = fetch field.at_xpath('spirit:name'), downcase: true, to_sym: true, get_text: true
72
90
  bit_offset = fetch field.at_xpath('spirit:bitOffset'), get_text: true, to_i: true
73
91
  bit_width = fetch field.at_xpath('spirit:bitWidth'), get_text: true, to_i: true
74
- access = fetch field.at_xpath('spirit:access'), get_text: true
75
- if access =~ /\S+\-\S+/
76
- access = access[/^(\S)/, 1] + access[/\-(\S)\S+$/, 1]
77
- access = access.downcase.to_sym
92
+ xml_access = fetch field.at_xpath('spirit:access'), get_text: true
93
+ # Newer IP-XACT standards list access as < read or write>-< descriptor >, such as
94
+ # "read-write", "read-only", or "read-writeOnce"
95
+ if xml_access =~ /\S+\-\S+/ || xml_access == 'writeOnce'
96
+ # This filter alone is not capable of interpreting the 1685-2009 (and 2014). Therefore
97
+ # must reverse-interpret the content of access_hash (see top of file).
98
+ #
99
+ # First get the base access type, ie: read-write, read-only, etc.
100
+ # base_access = fetch field.at_xpath('spirit:access'), get_text: true
101
+ base_access = xml_access
102
+ # Next grab any modified write values or read actions
103
+ mod_write = fetch field.at_xpath('spirit:modifiedWriteValue'), get_text: true
104
+ read_action = fetch field.at_xpath('spirit:readAction'), get_text: true
105
+ # Using base_access, mod_write, and read_action, look up the corresponding access
106
+ # acronym from access_hash, noting it is not possible to differentiate write-only
107
+ # from write-only, read zero and read-write from dc.
108
+ #
109
+ # Matched needs to be tracked, as there is no way to differentiate :rw and :dc in IP-XACT.
110
+ # Everything imported will default to :rw, never :dc.
111
+ matched = false
112
+ @@access_hash.each_key do |key|
113
+ if @@access_hash[key][:base] == base_access && @@access_hash[key][:write] == mod_write && @@access_hash[key][:read] == read_action && !matched
114
+ access = key.to_sym
115
+ matched = true
116
+ end
117
+ end
118
+ # Older IP-XACT standards appear to also accept short acronyms like "ro", "w1c", "rw",
119
+ # etc.
120
+ elsif xml_access =~ /\S+/
121
+ access = xml_access.downcase.to_sym
78
122
  else
79
123
  # default to read-write if access is not specified
80
124
  access = :rw
@@ -93,7 +137,7 @@ module CrossOrigen
93
137
  end
94
138
  end
95
139
  model.export(filename, include_timestamp: CrossOrigen.include_timestamp?)
96
- owner.import(filename)
140
+ owner.import(filename, options)
97
141
  end
98
142
 
99
143
  def doc(path, options = {})
@@ -117,6 +161,14 @@ xsi:schemaLocation="$REGMEM_HOME/builder/ipxact/schema/ipxact
117
161
  end
118
162
 
119
163
  # Returns a string representing the owner object in IP-XACT XML
164
+ # Usable / Available options:
165
+ # :vendor = Company name/web address, ex: 'nxp.com'
166
+ # :library = IP Library
167
+ # :schema = '1685-2009' or default of Spirit 1.4 (when no :schema option passed)
168
+ # :bus_interface = only 'AMBA3' supported at this time
169
+ # :mmap_name = Optionally set the memoryMap name to something other than the module name
170
+ # :mmap_ref = memoryMapRef name, ex: 'UserMap'
171
+ # :addr_block_name = addressBlock -> Name, ex: 'ATX'
120
172
  def owner_to_xml(options = {})
121
173
  require 'nokogiri'
122
174
 
@@ -126,21 +178,43 @@ xsi:schemaLocation="$REGMEM_HOME/builder/ipxact/schema/ipxact
126
178
 
127
179
  @format = options[:format]
128
180
 
129
- schemas = [
130
- 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4',
131
- 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4/index.xsd'
132
- ]
133
- if uvm?
181
+ # Compatible schemas: Spirit 1.4, 1685-2009
182
+ # Assume Spirit 1.4 if no schema provided
183
+ if options[:schema] == '1685-2009' # Magillem tool uses alternate schema
184
+ schemas = [
185
+ 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009',
186
+ 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009/index.xsd'
187
+ ]
188
+ else # Assume Spirit 1.4 if not
189
+ schemas = [
190
+ 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4',
191
+ 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4/index.xsd'
192
+ ]
193
+ end
194
+
195
+ if uvm? && !(options[:schema] == '1685-2009')
134
196
  schemas << '$IREG_GEN/XMLSchema/SPIRIT/VendorExtensions.xsd'
135
197
  end
136
198
 
137
- headers = {
138
- 'xmlns:spirit' => 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4',
139
- 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
140
- 'xsi:schemaLocation' => schemas.join(' ')
141
- }
142
- if uvm?
199
+ if options[:schema] == '1685-2009' # Magillem tool uses alternate schema
200
+ headers = {
201
+ 'xmlns:spirit' => 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1685-2009',
202
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
203
+ 'xsi:schemaLocation' => schemas.join(' ')
204
+ }
205
+ else # Assume Spirit 1.4 if not
206
+ headers = {
207
+ 'xmlns:spirit' => 'http://www.spiritconsortium.org/XMLSchema/SPIRIT/1.4',
208
+ 'xmlns:xsi' => 'http://www.w3.org/2001/XMLSchema-instance',
209
+ 'xsi:schemaLocation' => schemas.join(' ')
210
+ }
211
+ end
212
+
213
+ if uvm? && !(options[:schema] == '1685-2009')
143
214
  headers['xmlns:vendorExtensions'] = '$IREG_GEN/XMLSchema/SPIRIT'
215
+ # Else:
216
+ # Do nothing ?
217
+ # headers['xmlns:vendorExtensions'] = '$UVM_RGM_HOME/builder/ipxact/schema'
144
218
  end
145
219
 
146
220
  builder = Nokogiri::XML::Builder.new(encoding: 'UTF-8') do |xml|
@@ -151,19 +225,48 @@ xsi:schemaLocation="$REGMEM_HOME/builder/ipxact/schema/ipxact
151
225
  # I guess this should really be the register owner's owner's name?
152
226
  spirit.name try(:ip_name) || owner.class.to_s.split('::').last
153
227
  spirit.version try(:ip_version, :version, :revision)
228
+ # The 1685-2009 schema allows for a bus interface. AMBA3 (slave) supported so far.
229
+ if options[:schema] == '1685-2009'
230
+ if options[:bus_interface] == 'AMBA3'
231
+ spirit.busInterfaces do
232
+ spirit.busInterface do
233
+ spirit.name 'Slave'
234
+ bustype_header = {
235
+ 'spirit:vendor' => options[:vendor] || 'Origen',
236
+ 'spirit:library' => 'amba3',
237
+ 'spirit:name' => 'APB3',
238
+ 'spirit:version' => '1.0'
239
+ }
240
+ xml['spirit'].busType bustype_header
241
+ spirit.slave do
242
+ mmapref_header = {
243
+ 'spirit:memoryMapRef' => options[:mmap_ref] || 'APB'
244
+ }
245
+ xml['spirit'].memoryMapRef mmapref_header
246
+ end
247
+ end
248
+ end
249
+ end
250
+ end
154
251
  spirit.memoryMaps do
155
252
  memory_maps.each do |map_name, _map|
156
253
  spirit.memoryMap do
157
- spirit.name map_name
254
+ # Optionally assign memory map name to something other than the module name in Ruby,
255
+ # default to 'RegisterMap'
256
+ spirit.name options[:mmap_name] || 'RegisterMap'
158
257
  address_blocks do |domain_name, _domain, sub_block|
159
258
  spirit.addressBlock do
259
+ # When registers reside at the top level, do not assign an address block name
160
260
  if sub_block == owner
161
- spirit.name nil
162
- spirit.baseAddress 0.to_hex
261
+ if options[:addr_block_name].nil?
262
+ spirit.name nil
263
+ else
264
+ spirit.name options[:addr_block_name]
265
+ end
163
266
  else
164
267
  spirit.name address_block_name(domain_name, sub_block)
165
- spirit.baseAddress sub_block.base_address.to_hex
166
268
  end
269
+ spirit.baseAddress sub_block.base_address.to_hex
167
270
  spirit.range range(sub_block)
168
271
  spirit.width width(sub_block)
169
272
  sub_block.regs.each do |name, reg|
@@ -189,7 +292,94 @@ xsi:schemaLocation="$REGMEM_HOME/builder/ipxact/schema/ipxact
189
292
  spirit.description try(bits, :brief_description, :name_full, :full_name)
190
293
  spirit.bitOffset bits.position
191
294
  spirit.bitWidth bits.size
192
- spirit.access bits.access
295
+ # When exporting to 1685-2009 schema, need to handle special cases (writeOnce),
296
+ # modifiedWriteValue, and readAction fields.
297
+ if options[:schema] == '1685-2009'
298
+ if bits.writable? && bits.readable?
299
+ if bits.access == :w1
300
+ spirit.access 'read-writeOnce'
301
+ else
302
+ spirit.access 'read-write'
303
+ end
304
+ elsif bits.writable?
305
+ if bits.access == :wo1
306
+ spirit.access 'writeOnce'
307
+ else
308
+ spirit.access 'write-only'
309
+ end
310
+ elsif bits.readable?
311
+ spirit.access 'read-only'
312
+ end
313
+ if bits.readable?
314
+ unless @@access_hash[bits.access][:read].nil?
315
+ spirit.readAction @@access_hash[bits.access][:read]
316
+ end
317
+ end
318
+ if bits.writable?
319
+ unless @@access_hash[bits.access][:write].nil?
320
+ spirit.modifiedWriteValue @@access_hash[bits.access][:write]
321
+ end
322
+ end
323
+ else # Assume Spirit 1.4 if not
324
+ spirit.access bits.access
325
+ end
326
+ # HDL paths provide hooks for a testbench to directly manipulate the
327
+ # registers without having to go through a bus interface or read/write
328
+ # protocol. Because the hierarchical path to a register block can vary
329
+ # greatly between devices, allow the user to provide an abs_path value
330
+ # and define "full_reg_path" to assist.
331
+ #
332
+ # When registers reside at the top level without a specified path, use 'top'.
333
+ if reg.owner.path.nil? || reg.owner.path.empty?
334
+ regpath = 'top'
335
+ else
336
+ regpath = reg.owner.path
337
+ end
338
+ # If :full_reg_path is defined, the :abs_path metadata for a register will
339
+ # be used for regpath. This can be assigned at an address block (sub-block)
340
+ # level.
341
+ unless options[:full_reg_path].nil? == true
342
+ regpath = reg.path
343
+ end
344
+ if options[:schema] == '1685-2009'
345
+ spirit.parameters do
346
+ spirit.parameter do
347
+ spirit.name '_hdlPath_'
348
+ # HDL path needs to be to the declared bit field name, NOT to the bus slice
349
+ # that Origen's "abs_path" will yield. Ex:
350
+ #
351
+ # ~~~ ruby
352
+ # reg :myreg, 0x0, size: 32 do |reg|
353
+ # bits 7..4, :bits_high
354
+ # bits 3..0, :bits_low
355
+ # end
356
+ # ~~~
357
+ #
358
+ # The abs_path to ...regs(:myreg).bits(:bits_low).abs_path will yield
359
+ # "myreg.myreg[3:0]", not "myreg.bits_low". This is not an understood path
360
+ # in Origen (myreg[3:0] does not exist in either myreg's RegCollection or BitCollection),
361
+ # and does not sync with how RTL would create bits_low[3:0].
362
+ # Therefore, use the path to "myreg"'s owner appended with bits.name (bits_low here).
363
+ #
364
+ # This can be done in a register or sub_blocks definition by defining register
365
+ # metadata for "abs_path". If the reg owner's path weren't used, but instead the
366
+ # reg's path, that would imply each register was a separate hierarchical path in
367
+ # RTL (ex: "top.myblock.regblock.myreg.myreg_bits"), which is normally not the case.
368
+ # The most likely path would be "top.myblock.regblock.myreg_bits.
369
+ spirit.value "#{regpath}.#{bits.name}"
370
+ end
371
+ end
372
+ end
373
+ # C. Hume - Unclear which vendorExtensions should be included by default, if any.
374
+ # Future improvment: Allow passing of vendorExtensions enable & value hash/string
375
+ # if options[:schema] == '1685-2009'
376
+ # spirit.vendorExtensions do
377
+ # vendorext = { 'xmlns:vendorExtensions' => '$UVM_RGM_HOME/builder/ipxact/schema' }
378
+ # xml['vendorExtensions'].hdl_path vendorext, "#{reg.path}.#{bits.name}"
379
+ # end
380
+ # end
381
+
382
+ # Allow optional inclusion of bit field values and descriptions
193
383
  if options[:include_bit_field_values]
194
384
  if bits.bit_value_descriptions[0]
195
385
  bits.bit_value_descriptions.each do |val, desc|
@@ -201,28 +391,46 @@ xsi:schemaLocation="$REGMEM_HOME/builder/ipxact/schema/ipxact
201
391
  end
202
392
  end
203
393
  end
204
- if uvm?
394
+ if uvm? && !(options[:schema] == '1685-2009')
205
395
  spirit.vendorExtensions do
206
- xml['vendorExtensions'].hdl_path bits.path(relative_to: sub_block)
396
+ xml['vendorExtensions'].hdl_path "#{regpath}.#{bits.name}"
207
397
  end
208
398
  end
209
399
  end
210
400
  end
211
401
  end
212
402
  end
213
- if uvm?
214
- spirit.vendorExtensions do
215
- xml['vendorExtensions'].hdl_path sub_block.path(relative_to: owner)
216
- end
217
- end
403
+ # Unclear whether addressBlock vendor extensions are supported in Spirit 1.4
404
+ # if uvm?
405
+ # spirit.vendorExtensions do
406
+ # xml['vendorExtensions'].hdl_path sub_block.path(relative_to: owner)
407
+ # end
408
+ # end
409
+ end
410
+ end
411
+ # Assume byte addressing if not specified
412
+ if owner.methods.include?(:lau) == false
413
+ if methods.include?(:lau) == true
414
+ spirit.addressUnitBits lau
415
+ else
416
+ spirit.addressUnitBits 8
218
417
  end
418
+ else
419
+ spirit.addressUnitBits owner.lau
219
420
  end
220
421
  end
221
422
  end
222
423
  end
223
424
  end
224
425
  end
225
- builder.to_xml
426
+ # When testing with 'origen examples', travis_ci (bash) will end up with empty tags -
427
+ # '<spirit:description/>' that do not appear on some user's tshell environments. To
428
+ # prevent false errors for this issue, force Nokogiri to use self-closing tags
429
+ # ('<spirit:description></spirit:description>'), but keep the XML formatted for readability.
430
+ # All tags with no content will appear as '<spirit:tag_name></spirit:tag_name>'.
431
+ #
432
+ builder.to_xml(save_with: Nokogiri::XML::Node::SaveOptions::NO_EMPTY_TAGS |
433
+ Nokogiri::XML::Node::SaveOptions::FORMAT)
226
434
  end
227
435
 
228
436
  private
@@ -22,6 +22,7 @@ module CrossOrigenDev
22
22
  cr_import(path: "#{Origen.root}/imports/ipxact.xml")
23
23
  end
24
24
 
25
+ # Import Spirit 1.4 version of ATX
25
26
  def add_atx2
26
27
  sub_block :atx2, class_name: 'ATX2', base_address: 0x6000_0000
27
28
  end
@@ -31,7 +32,21 @@ module CrossOrigenDev
31
32
  include CrossOrigen
32
33
 
33
34
  def initialize
34
- cr_import(path: "#{Origen.root}/approved/ip_xact_sub_block.xml")
35
+ cr_import(path: "#{Origen.root}/approved/ip_xact_sub_block.xml", refresh: true)
36
+ end
37
+ end
38
+
39
+ # Import 1685-2009 version of ATX
40
+ def add_atx3
41
+ sub_block :atx3, class_name: 'ATX3', base_address: 0x7000_0000
42
+ end
43
+
44
+ class ATX3
45
+ include Origen::Model
46
+ include CrossOrigen
47
+
48
+ def initialize
49
+ cr_import(path: "#{Origen.root}/approved/ip_xact_sub_block_1685.xml", refresh: true)
35
50
  end
36
51
  end
37
52
 
@@ -40,21 +55,65 @@ module CrossOrigenDev
40
55
  include CrossOrigen
41
56
 
42
57
  def initialize
43
- # A manually defined register for testing the conversion of any specific attributes
58
+ # A manually defined set of registers for testing the conversion of any specific attributes
44
59
 
45
- # ** MGATE Clock Divider Register **
46
- # The MCLKDIV register is used to divide down the frequency of the HBOSCCLK input. If the MCLKDIV
60
+ # ** MPU Clock Divider Register **
61
+ #
62
+ # The MCLKDIV register is used to divide down the frequency of the OSCCLK input. If the MCLKDIV
47
63
  # register is set to value "N", then the output (beat) frequency of the clock divider is OSCCLK / (N+1). The
48
- # resulting beats are, in turn, counted by the PTIMER module to control the duration of Flash high-voltage
49
- # operations.
64
+ # resulting beats are, in turn, counted by the TIMER module to control the duration of operations.
50
65
  # This is a test of potentially problematic characters ' " \' \" < >
51
66
  reg :mclkdiv, 0x0, size: 16, bit_order: 'decrement' do
52
- # **Oscillator (Hi)** - Firmware FMU clk source selection. (Note that in addition to this firmware-controlled bit, the
53
- # FMU clock source is also dependent on test and power control discretes).
67
+ # **Oscillator (Hi)** - Clock source selection. (Note that in addition to this firmware-controlled bit, the
68
+ # clock source is also dependent on test and power control discretes).
54
69
  #
55
- # 0 | FMU clock is the externally supplied bus clock ipg_clk
56
- # 1 | FMU clock is the internal oscillator from the TFS hardblock
70
+ # 0 | Clock is the externally supplied bus clock bus_clk
71
+ # 1 | Clock is the internal oscillator from the hardblock
57
72
  bit 15, :osch, reset: 1, access: :rw
73
+ # **Divider Value**
74
+ #
75
+ # Used to set clock divider value and test multi-bit import in CrossOrigen
76
+ bits 3..0, :div
77
+ end
78
+
79
+ # **Access Type Test Register**
80
+ #
81
+ # This register tests the IP-XACT export of various bit access types, such as write-one-to-clear,
82
+ # read-only, etc.
83
+ reg :access_types, 0x4, size: 32 do
84
+ # Test read-only access.
85
+ bit 31, :readonly, access: :ro
86
+ # Test read-write access.
87
+ bit 30, :readwrite, access: :rw
88
+ # Test read-clear access, where a read clears the value afterwards.
89
+ bit 29, :readclear, access: :rc
90
+ # Test read-set access, where a read sets the bit afterwards.
91
+ bit 28, :readset, access: :rs
92
+ # Test writable, clear-on-read access, etc...
93
+ bit 27, :writablereadclear, access: :wrc
94
+ bit 26, :writablereadset, access: :wrs
95
+ bit 25, :writeclear, access: :wc
96
+ bit 24, :writeset, access: :ws
97
+ bit 23, :writesetreadclear, access: :wsrc
98
+ bit 22, :writeclearreadset, access: :wcrs
99
+ bit 21, :write1toclear, access: :w1c
100
+ bit 20, :write1toset, access: :w1s
101
+ bit 19, :write1totoggle, access: :w1t
102
+ bit 18, :write0toclear, access: :w0c
103
+ bit 17, :write0toset, access: :w0s
104
+ bit 16, :write0totoggle, access: :w0t
105
+ bit 15, :write1tosetreadclear, access: :w1src
106
+ bit 14, :write1toclearreadset, access: :w1crs
107
+ bit 13, :write0tosetreadclear, access: :w0src
108
+ bit 12, :write0toclearreadset, access: :w0crs
109
+ bit 11, :writeonly, access: :wo
110
+ bit 10, :writeonlyclear, access: :woc
111
+ bit 9, :writeonlyreadzero, access: :worz
112
+ bit 8, :writeonlyset, access: :wos
113
+ bit 7, :writeonce, access: :w1
114
+ bit 6, :writeonlyonce, access: :wo1
115
+ bit 5, :readwritenocheck, access: :dc
116
+ bit 4, :readonlyclearafter, access: :rowz
58
117
  end
59
118
  end
60
119
  end
@@ -0,0 +1 @@
1
+ <%= $dut.to_ip_xact :format => :uvm, :schema=> '1685-2009', :mmap_name => 'RegisterMap', :vendor => 'origen-sdk.org', :library => 'id', :name => 'ipxact', :mmap_ref => 'test', :bus_interface => 'AMBA3' %>
@@ -0,0 +1 @@
1
+ <%= $dut.atx.to_ip_xact :format => :uvm, :schema=> '1685-2009', :mmap_name => 'RegisterMap', :vendor => 'origen-sdk.org', :library => 'id', :name => 'ipxact_1685_2009' %>
@@ -6,7 +6,8 @@ The following examples are available which are used for testing but
6
6
  also provide some code examples of how to use the plugin for the various
7
7
  supported formats:
8
8
 
9
- * [IP-XACT Export](<%= path "examples/ip_xact_export" %>)
9
+ * [Spirit 1.4 IP-XACT Export](<%= path "examples/ip_xact_export" %>)
10
+ * [IEEE 1685-2009 IP-XACT Export](<%= path "examples/ip_xact_export_1685_2009" %>)
10
11
  * [RALF Export](<%= path "examples/ralf_export" %>)
11
12
  * [Origen Export](<%= path "examples/origen_export" %>)
12
13
 
@@ -1,6 +1,6 @@
1
1
  % render "layouts/basic.html", tab: :examples do
2
2
 
3
- ## IP-XACT Export
3
+ ## IP-XACT Export (Spirit 1.4)
4
4
 
5
5
  This page shows IP-XACT formatted XML that has been generated from an Origen
6
6
  representation of a module.
@@ -0,0 +1,32 @@
1
+ % render "layouts/basic.html", tab: :examples do
2
+
3
+ ## IP-XACT Export (IEEE 1685-2009)
4
+
5
+ This page shows IEEE 1685-2009 IP-XACT formatted XML that has been generated from an Origen
6
+ representation of a module.
7
+
8
+ The exporter has the following options:
9
+
10
+ * **:format** - nil by default, can be set to :uvm to include the associated vendor
11
+ extentions
12
+ * **:include_bit_field_values** - true by default, when false the bit field values
13
+ fields will not be output
14
+ * **:schema** - nil by default, which assumes a Spirit 1.4 format. '1685-2009' is also supported.
15
+ * **:mmap_name** - nil by default, can be set to any string name for the memory map name.
16
+ * **:mmap_ref** - nil by default, can be set to any string name for the memory map reference used by a downstream tool.
17
+ * **:vendor** - nil by default, can be set to any string name for the company name.
18
+ * **:library** - nil by default, can be set to any string name for the library used by a downstream tool (ex: Magillem XML -> UVM conversion)
19
+ %#* **:name** - nil by default, can be set to any string name for the an overall device/model name.
20
+ %#* **:bus_interface** - nil by default, can be set to 'AMBA3' for an AMBA3 bus interface.
21
+
22
+ For this example, targeting CrossOrigen's target/debug.rb, the code to generate this page is:
23
+
24
+ ~~~eruby
25
+ <%= "<" + "%= $dut.to_ip_xact :format => :uvm, :schema=> '1685-2009', :mmap_name => 'RegisterMap', :vendor => 'origen-sdk.org', :library => 'id', :mmap_ref => 'test' %" + ">" %>
26
+ ~~~
27
+
28
+ ~~~xml
29
+ <%= $dut.to_ip_xact :format => :uvm, :schema=> '1685-2009', :mmap_name => 'RegisterMap', :vendor => 'origen-sdk.org', :library => 'id', :mmap_ref => 'test' %>
30
+ ~~~
31
+
32
+ % end
@@ -35,7 +35,7 @@ Currently the following formats are supported:
35
35
  * CMSIS-SVD - Import registers and hierarchy
36
36
  * RALF (Synopsys format) - Export registers
37
37
 
38
- See the [examples](<%= path "examples" %>) for format specific documentation, but
38
+ See the [Examples](<%= path "examples" %>) for format specific documentation, but
39
39
  most formats should follow this basic structure...
40
40
 
41
41
  #### Data Import
@@ -100,7 +100,9 @@ and then compiled through Origen:
100
100
  <%= "<" + "%= $dut.to_ip_xact %" + ">" %>
101
101
  ~~~
102
102
 
103
- In future support may be added to export directly to a 3rd party tool if
103
+ Please explore the [Examples](<%= path "examples" %>) page to see the differences between Spirit 1.4 and IEEE 1685-2009 IP-XACT export settings.
104
+
105
+ In the future, support may be added to export directly to a 3rd party tool if
104
106
  it provides such an API.
105
107
 
106
108
  ### How To Setup a Development Environment
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cross_origen
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephen McGinty
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-11 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: origen
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '0.32'
19
+ version: 0.59.7
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '0.32'
26
+ version: 0.59.7
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: sanitize
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -45,7 +45,6 @@ executables: []
45
45
  extensions: []
46
46
  extra_rdoc_files: []
47
47
  files:
48
- - bin/fix_my_workspace
49
48
  - config/application.rb
50
49
  - config/boot.rb
51
50
  - config/commands.rb
@@ -65,11 +64,14 @@ files:
65
64
  - templates/test/default.ralf.erb
66
65
  - templates/test/headers_default.h.erb
67
66
  - templates/test/ip_xact.xml.erb
67
+ - templates/test/ip_xact_1685-2009.xml.erb
68
68
  - templates/test/ip_xact_sub_block.xml.erb
69
+ - templates/test/ip_xact_sub_block_1685.xml.erb
69
70
  - templates/web/_history.md
70
71
  - templates/web/example.md.erb
71
72
  - templates/web/examples.md.erb
72
73
  - templates/web/examples/ip_xact_export.md.erb
74
+ - templates/web/examples/ip_xact_export_1685_2009.md.erb
73
75
  - templates/web/examples/origen_export.md.erb
74
76
  - templates/web/examples/ralf_export.md.erb
75
77
  - templates/web/index.md.erb
@@ -94,8 +96,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
94
96
  - !ruby/object:Gem::Version
95
97
  version: 1.8.11
96
98
  requirements: []
97
- rubyforge_project:
98
- rubygems_version: 2.6.7
99
+ rubygems_version: 3.1.4
99
100
  signing_key:
100
101
  specification_version: 4
101
102
  summary: Translators for importing and exporting Origen data to/from 3rd party formats
data/bin/fix_my_workspace DELETED
@@ -1,100 +0,0 @@
1
- #!/usr/bin/env ruby
2
- $VERBOSE = nil # Don't care about world writable dir warnings and the like
3
-
4
- if $_fix_my_workspace_version_check
5
- $_fix_my_workspace_version = '0.7.0'
6
- else
7
- if File.exist?(File.expand_path('../../lib/origen.rb', __FILE__))
8
- # If this script is being run from within an origen-core workspace, use that Origen-core,
9
- # not the system-installed origen-core version.
10
- $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
11
- require 'origen'
12
- else
13
- # Use system-installed Origen (the gem in system Ruby)
14
- require 'origen'
15
- end
16
-
17
- if !Origen.site_config.gem_manage_bundler
18
- puts 'Sorry but you have opted to manage Bundler yourself via your Origen site config, and this means'
19
- puts 'that I cannot make certain assumptions about how your workspace is configured.'
20
- puts 'You will need to either resolve this problem yourself, or else change the value of'
21
- puts 'gem_mange_bundler to true.'
22
- puts 'See here for more details on how to do that: http://origen-sdk.org/origen/guides/starting/company/'
23
-
24
- else
25
- ENV['BUNDLE_GEMFILE'] = File.join(Origen.root, 'Gemfile')
26
- ENV['BUNDLE_PATH'] = File.expand_path(Origen.site_config.gem_install_dir)
27
- ENV['BUNDLE_BIN'] = File.join(Origen.root, 'lbin')
28
-
29
- # Force copy system gems to local gems
30
- if Origen.site_config.gem_use_from_system
31
- local_gem_dir = "#{ENV['BUNDLE_PATH']}/ruby/#{Pathname.new(Gem.dir).basename}"
32
- gem_dir = Pathname.new(Gem.dir)
33
-
34
- Origen.site_config.gem_use_from_system.each do |gem, version|
35
- begin
36
- # This will raise an error if the system doesn't have this gem installed, that
37
- # will be rescued below
38
- spec = Gem::Specification.find_by_name(gem, version)
39
-
40
- local_dir = File.join(local_gem_dir, Pathname.new(spec.gem_dir).relative_path_from(gem_dir))
41
- FileUtils.mkdir_p local_dir
42
- FileUtils.cp_r("#{spec.gem_dir}/.", local_dir)
43
-
44
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.cache_file).relative_path_from(gem_dir)))
45
- FileUtils.mkdir_p local_file.dirname
46
- FileUtils.cp(spec.cache_file, local_file)
47
-
48
- if spec.extension_dir && File.exist?(spec.extension_dir)
49
- local_dir = File.join(local_gem_dir, Pathname.new(spec.extension_dir).relative_path_from(gem_dir))
50
- FileUtils.mkdir_p local_dir
51
- FileUtils.cp_r("#{spec.extension_dir}/.", local_dir)
52
- end
53
-
54
- local_file = Pathname.new(File.join(local_gem_dir, Pathname.new(spec.spec_file).relative_path_from(gem_dir)))
55
- FileUtils.mkdir_p local_file.dirname
56
- FileUtils.cp(spec.spec_file, local_file)
57
-
58
- rescue Gem::LoadError
59
- # This just means that one of the gems that should be copied from the system
60
- # was not actually installed in the system, so nothing we can do about that here
61
- end
62
- end
63
- end
64
-
65
- # Delete lbin
66
- FileUtils.rm_rf(ENV['BUNDLE_BIN']) if File.exist?(ENV['BUNDLE_BIN'])
67
-
68
- # Run bundler with correct switches
69
- cmd = "bundle install --gemfile #{ENV['BUNDLE_GEMFILE']} --binstubs #{ENV['BUNDLE_BIN']} --path #{ENV['BUNDLE_PATH']}"
70
- `chmod o-w #{Origen.root}` # Stops some annoying world writable warnings during install
71
- `chmod o-w #{Origen.root}/bin` if File.exist?("#{Origen.root}/bin")
72
- `chmod o-w #{Origen.root}/.bin` if File.exist?("#{Origen.root}/.bin")
73
-
74
- # Try again, this time updating the bundle
75
- if system(cmd)
76
- fixed = true
77
- elsif system 'bundle update'
78
- fixed = true
79
- end
80
-
81
- if File.exist?(ENV['BUNDLE_BIN'])
82
- `chmod o-w #{ENV['BUNDLE_BIN']}`
83
-
84
- # Make .bat versions of all executables, Bundler should really be doing this when running
85
- # on windows
86
- if Origen.os.windows?
87
- Dir.glob("#{ENV['BUNDLE_BIN']}/*").each do |bin|
88
- unless bin =~ /.bat$/
89
- bat = "#{bin}.bat"
90
- unless File.exist?(bat)
91
- File.open(bat, 'w') { |f| f.write('@"ruby.exe" "%~dpn0" %*') }
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- system 'origen -v' if fixed
99
- end
100
- end