rggen-vhdl 0.10.1 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (33) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +1 -1
  4. data/lib/rggen/vhdl/bit_field/type/custom.rb +8 -8
  5. data/lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.rb +3 -3
  6. data/lib/rggen/vhdl/bit_field/type/ro_rotrg.rb +2 -2
  7. data/lib/rggen/vhdl/bit_field/type/rohw.rb +3 -3
  8. data/lib/rggen/vhdl/bit_field/type/row0trg_row1trg.rb +2 -2
  9. data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.rb +4 -4
  10. data/lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.rb +2 -2
  11. data/lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.rb +3 -3
  12. data/lib/rggen/vhdl/bit_field/type/rwc.rb +2 -2
  13. data/lib/rggen/vhdl/bit_field/type/rwe_rwl.rb +2 -2
  14. data/lib/rggen/vhdl/bit_field/type/rwhw.rb +3 -3
  15. data/lib/rggen/vhdl/bit_field/type/rws.rb +2 -2
  16. data/lib/rggen/vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.rb +1 -1
  17. data/lib/rggen/vhdl/bit_field/type/w0t_w1t.rb +1 -1
  18. data/lib/rggen/vhdl/bit_field/type/w0trg_w1trg.rb +1 -1
  19. data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.rb +2 -2
  20. data/lib/rggen/vhdl/bit_field/type/wrc_wrs.rb +1 -1
  21. data/lib/rggen/vhdl/feature.rb +6 -6
  22. data/lib/rggen/vhdl/register/type/external.rb +1 -1
  23. data/lib/rggen/vhdl/register/type.rb +1 -1
  24. data/lib/rggen/vhdl/register_block/protocol/native.erb +34 -0
  25. data/lib/rggen/vhdl/register_block/protocol/native.rb +22 -0
  26. data/lib/rggen/vhdl/register_block/protocol.rb +3 -3
  27. data/lib/rggen/vhdl/register_block/vhdl_top.rb +1 -1
  28. data/lib/rggen/vhdl/register_map/keyword_checker.rb +40 -0
  29. data/lib/rggen/vhdl/register_map/name.rb +9 -0
  30. data/lib/rggen/vhdl/utility.rb +2 -2
  31. data/lib/rggen/vhdl/version.rb +1 -1
  32. data/lib/rggen/vhdl.rb +6 -0
  33. metadata +11 -10
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a40b2314cf782eff83c05a24378bdcdcb3022dc19df32e1eb3cf3c9bc8270f0b
4
- data.tar.gz: d3b5529f4247a8b1118859542328402bfc025290c1139b40c7d93ab62d6d4c2c
3
+ metadata.gz: abc5a2ebbca59bbc2bb69a1419edfebf28f65c8649bf51a855fc1131cb211aaf
4
+ data.tar.gz: '07536832610babc6a8e5dabb3112d452fa9f3e55195e13a618b2ba34cda8880e'
5
5
  SHA512:
6
- metadata.gz: 7b81bc63e6ab3ed5a4b0d4d948162ce575f604fb2de3f25d8941fe196ec6c8f399e8c3a909ecc239cb37e1e03ea314f220b88e83a8b80d33cc21519a900020eb
7
- data.tar.gz: 76f2b1ac8d10a91750b1ea5c24ab5b75ba78d5ef54e8d9ad178b32dfbe7b73fab0551733281d3ebf808ccb3640fff5bc8cf17695bc1a38cf4ea89e06f2835821
6
+ metadata.gz: 72d0c5ce29e1b5b3f0e4ca26dd6ed6b0b3d5eabab011c2b9cf5e4fb56b96def26383f079a187a4a5c3035c2f12d3d717396a9790b7539ec20ccbb757231550b5
7
+ data.tar.gz: f572366eca82a4b4ed2390cf3253bb037f752e90294ffbda4098dcd06c2334611ce23c51e7e91958b0ccff0e1efad78dfb44c625bbf1e348c3941d2a4603a3c2
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021-2024 Taichi Ishitani
3
+ Copyright (c) 2021-2025 Taichi Ishitani
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -68,7 +68,7 @@ Feedbacks, bus reports, questions and etc. are welcome! You can post them bu usi
68
68
 
69
69
  ## Copyright & License
70
70
 
71
- Copyright © 2021-2024 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
71
+ Copyright © 2021-2025 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
72
72
 
73
73
  ## Code of Conduct
74
74
 
@@ -5,39 +5,39 @@ RgGen.define_list_item_feature(:bit_field, :type, :custom) do
5
5
  build do
6
6
  if external_read_data?
7
7
  input :value_in, {
8
- name: "i_#{full_name}", width: width, array_size: array_size
8
+ name: "i_#{full_name}", width:, array_size:
9
9
  }
10
10
  else
11
11
  output :value_out, {
12
- name: "o_#{full_name}", width: width, array_size: array_size
12
+ name: "o_#{full_name}", width:, array_size:
13
13
  }
14
14
  end
15
15
  if bit_field.hw_write?
16
16
  input :hw_write_enable, {
17
- name: "i_#{full_name}_hw_write_enable", width: 1, array_size: array_size
17
+ name: "i_#{full_name}_hw_write_enable", width: 1, array_size:
18
18
  }
19
19
  input :hw_write_data, {
20
- name: "i_#{full_name}_hw_write_data", width: width, array_size: array_size
20
+ name: "i_#{full_name}_hw_write_data", width:, array_size:
21
21
  }
22
22
  end
23
23
  if bit_field.hw_set?
24
24
  input :hw_set, {
25
- name: "i_#{full_name}_hw_set", width: width, array_size: array_size
25
+ name: "i_#{full_name}_hw_set", width:, array_size:
26
26
  }
27
27
  end
28
28
  if bit_field.hw_clear?
29
29
  input :hw_clear, {
30
- name: "i_#{full_name}_hw_clear", width: width, array_size: array_size
30
+ name: "i_#{full_name}_hw_clear", width:, array_size:
31
31
  }
32
32
  end
33
33
  if bit_field.write_trigger?
34
34
  output :write_trigger, {
35
- name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
35
+ name: "o_#{full_name}_write_trigger", width: 1, array_size:
36
36
  }
37
37
  end
38
38
  if bit_field.read_trigger?
39
39
  output :read_trigger, {
40
- name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
40
+ name: "o_#{full_name}_read_trigger", width: 1, array_size:
41
41
  }
42
42
  end
43
43
  end
@@ -4,14 +4,14 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rc, :w0c, :w1c, :wc, :woc])
4
4
  vhdl do
5
5
  build do
6
6
  input :set, {
7
- name: "i_#{full_name}_set", width: width, array_size: array_size
7
+ name: "i_#{full_name}_set", width:, array_size:
8
8
  }
9
9
  output :value_out, {
10
- name: "o_#{full_name}", width: width, array_size: array_size
10
+ name: "o_#{full_name}", width:, array_size:
11
11
  }
12
12
  if bit_field.reference?
13
13
  output :value_unmasked, {
14
- name: "o_#{full_name}_unmasked", width: width, array_size: array_size
14
+ name: "o_#{full_name}_unmasked", width:, array_size:
15
15
  }
16
16
  end
17
17
  end
@@ -5,12 +5,12 @@ RgGen.define_list_item_feature(:bit_field, :type, [:ro, :rotrg]) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :value_in, {
8
- name: "i_#{full_name}", width: width, array_size: array_size
8
+ name: "i_#{full_name}", width:, array_size:
9
9
  }
10
10
  end
11
11
  if rotrg?
12
12
  output :read_trigger, {
13
- name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
13
+ name: "o_#{full_name}_read_trigger", width: 1, array_size:
14
14
  }
15
15
  end
16
16
  end
@@ -5,14 +5,14 @@ RgGen.define_list_item_feature(:bit_field, :type, :rohw) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :valid, {
8
- name: "i_#{full_name}_valid", width: 1, array_size: array_size
8
+ name: "i_#{full_name}_valid", width: 1, array_size:
9
9
  }
10
10
  end
11
11
  input :value_in, {
12
- name: "i_#{full_name}", width: width, array_size: array_size
12
+ name: "i_#{full_name}", width:, array_size:
13
13
  }
14
14
  output :value_out, {
15
- name: "o_#{full_name}", width: width, array_size: array_size
15
+ name: "o_#{full_name}", width:, array_size:
16
16
  }
17
17
  end
18
18
 
@@ -5,11 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:row0trg, :row1trg]) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :value_in, {
8
- name: "i_#{full_name}", width: width, array_size: array_size
8
+ name: "i_#{full_name}", width:, array_size:
9
9
  }
10
10
  end
11
11
  output :trigger, {
12
- name: "o_#{full_name}_trigger", width: width, array_size: array_size
12
+ name: "o_#{full_name}_trigger", width:, array_size:
13
13
  }
14
14
  end
15
15
 
@@ -4,19 +4,19 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rowo, :rowotrg]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
7
+ name: "o_#{full_name}", width:, array_size:
8
8
  }
9
9
  unless bit_field.reference?
10
10
  input :value_in, {
11
- name: "i_#{full_name}", width: width, array_size: array_size
11
+ name: "i_#{full_name}", width:, array_size:
12
12
  }
13
13
  end
14
14
  if rowotrg?
15
15
  output :write_trigger, {
16
- name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
16
+ name: "o_#{full_name}_write_trigger", width: 1, array_size:
17
17
  }
18
18
  output :read_trigger, {
19
- name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
19
+ name: "o_#{full_name}_read_trigger", width: 1, array_size:
20
20
  }
21
21
  end
22
22
  end
@@ -4,10 +4,10 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rs, :w0s, :w1s, :ws, :wos])
4
4
  vhdl do
5
5
  build do
6
6
  input :clear, {
7
- name: "i_#{full_name}_clear", width: width, array_size: array_size
7
+ name: "i_#{full_name}_clear", width:, array_size:
8
8
  }
9
9
  output :value_out, {
10
- name: "o_#{full_name}", width: width, array_size: array_size
10
+ name: "o_#{full_name}", width:, array_size:
11
11
  }
12
12
  end
13
13
 
@@ -4,14 +4,14 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rw, :rwtrg, :w1]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
7
+ name: "o_#{full_name}", width:, array_size:
8
8
  }
9
9
  if rwtrg?
10
10
  output :write_trigger, {
11
- name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
11
+ name: "o_#{full_name}_write_trigger", width: 1, array_size:
12
12
  }
13
13
  output :read_trigger, {
14
- name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
14
+ name: "o_#{full_name}_read_trigger", width: 1, array_size:
15
15
  }
16
16
  end
17
17
  end
@@ -5,11 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, :rwc) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :clear, {
8
- name: "i_#{full_name}_clear", width: 1, array_size: array_size
8
+ name: "i_#{full_name}_clear", width: 1, array_size:
9
9
  }
10
10
  end
11
11
  output :value_out, {
12
- name: "o_#{full_name}", width: width, array_size: array_size
12
+ name: "o_#{full_name}", width:, array_size:
13
13
  }
14
14
  end
15
15
 
@@ -6,11 +6,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:rwe, :rwl]) do
6
6
  unless bit_field.reference?
7
7
  input :control, {
8
8
  name: "i_#{full_name}_#{enable_or_lock}",
9
- width: 1, array_size: array_size
9
+ width: 1, array_size:
10
10
  }
11
11
  end
12
12
  output :value_out, {
13
- name: "o_#{full_name}", width: width, array_size: array_size
13
+ name: "o_#{full_name}", width:, array_size:
14
14
  }
15
15
  end
16
16
 
@@ -5,14 +5,14 @@ RgGen.define_list_item_feature(:bit_field, :type, :rwhw) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :valid, {
8
- name: "i_#{full_name}_valid", width: 1, array_size: array_size
8
+ name: "i_#{full_name}_valid", width: 1, array_size:
9
9
  }
10
10
  end
11
11
  input :value_in, {
12
- name: "i_#{full_name}", width: width, array_size: array_size
12
+ name: "i_#{full_name}", width:, array_size:
13
13
  }
14
14
  output :value_out, {
15
- name: "o_#{full_name}", width: width, array_size: array_size
15
+ name: "o_#{full_name}", width:, array_size:
16
16
  }
17
17
  end
18
18
 
@@ -5,11 +5,11 @@ RgGen.define_list_item_feature(:bit_field, :type, :rws) do
5
5
  build do
6
6
  unless bit_field.reference?
7
7
  input :set, {
8
- name: "i_#{full_name}_set", width: 1, array_size: array_size
8
+ name: "i_#{full_name}_set", width: 1, array_size:
9
9
  }
10
10
  end
11
11
  output :value_out, {
12
- name: "o_#{full_name}", width: width, array_size: array_size
12
+ name: "o_#{full_name}", width:, array_size:
13
13
  }
14
14
  end
15
15
 
@@ -6,7 +6,7 @@ RgGen.define_list_item_feature(
6
6
  vhdl do
7
7
  build do
8
8
  output :value_out, {
9
- name: "o_#{full_name}", width: width, array_size: array_size
9
+ name: "o_#{full_name}", width:, array_size:
10
10
  }
11
11
  end
12
12
 
@@ -4,7 +4,7 @@ RgGen.define_list_item_feature(:bit_field, :type, [:w0t, :w1t]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
7
+ name: "o_#{full_name}", width:, array_size:
8
8
  }
9
9
  end
10
10
 
@@ -4,7 +4,7 @@ RgGen.define_list_item_feature(:bit_field, :type, [:w0trg, :w1trg]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :trigger, {
7
- name: "o_#{full_name}_trigger", width: width, array_size: array_size
7
+ name: "o_#{full_name}_trigger", width:, array_size:
8
8
  }
9
9
  end
10
10
 
@@ -4,11 +4,11 @@ RgGen.define_list_item_feature(:bit_field, :type, [:wo, :wo1, :wotrg]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
7
+ name: "o_#{full_name}", width:, array_size:
8
8
  }
9
9
  if wotrg?
10
10
  output :write_trigger, {
11
- name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
11
+ name: "o_#{full_name}_write_trigger", width: 1, array_size:
12
12
  }
13
13
  end
14
14
  end
@@ -4,7 +4,7 @@ RgGen.define_list_item_feature(:bit_field, :type, [:wrc, :wrs]) do
4
4
  vhdl do
5
5
  build do
6
6
  output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
7
+ name: "o_#{full_name}", width:, array_size:
8
8
  }
9
9
  end
10
10
 
@@ -7,19 +7,19 @@ module RgGen
7
7
 
8
8
  private
9
9
 
10
- def create_signal(_, attributes, &block)
11
- DataObject.new(:signal, attributes, &block)
10
+ def create_signal(_, attributes, &)
11
+ DataObject.new(:signal, attributes, &)
12
12
  end
13
13
 
14
- def create_port(direction, attributes, &block)
14
+ def create_port(direction, attributes, &)
15
15
  attributes =
16
16
  attributes
17
17
  .merge(direction: { input: :in, output: :out }[direction])
18
- DataObject.new(:port, attributes, &block)
18
+ DataObject.new(:port, attributes, &)
19
19
  end
20
20
 
21
- def create_generic(_, attributes, &block)
22
- DataObject.new(:generic, attributes, &block)
21
+ def create_generic(_, attributes, &)
22
+ DataObject.new(:generic, attributes, &)
23
23
  end
24
24
 
25
25
  define_entity :signal, :create_signal, :signal, -> { component }
@@ -5,7 +5,7 @@ RgGen.define_list_item_feature(:register, :type, :external) do
5
5
  build do
6
6
  generic :strobe_width, {
7
7
  name: "#{register.name}_STROBE_WIDTH".upcase,
8
- type: :positive, default: configuration.bus_width / 8
8
+ type: :positive, default: register_block.byte_width
9
9
  }
10
10
  output :external_valid, {
11
11
  name: "o_#{register.name}_valid"
@@ -98,7 +98,7 @@ RgGen.define_list_feature(:register, :type) do
98
98
 
99
99
  def format_offsets(offsets)
100
100
  if integer?(offsets.first)
101
- super(offsets)
101
+ super
102
102
  else
103
103
  super([0, *offsets])
104
104
  end
@@ -0,0 +1,34 @@
1
+ u_adapter: entity <%= library_name %>.rggen_native_adapter
2
+ generic map (
3
+ ADDRESS_WIDTH => <%= address_width %>,
4
+ LOCAL_ADDRESS_WIDTH => <%= local_address_width %>,
5
+ BUS_WIDTH => <%= bus_width %>,
6
+ STROBE_WIDTH => <%= strobe_width %>,
7
+ REGISTERS => <%= total_registers %>,
8
+ PRE_DECODE => <%= pre_decode %>,
9
+ BASE_ADDRESS => <%= base_address %>,
10
+ BYTE_SIZE => <%= byte_size %>,
11
+ ERROR_STATUS => <%= error_status %>,
12
+ INSERT_SLICER => <%= insert_slicer %>
13
+ )
14
+ port map (
15
+ i_clk => <%= register_block.clock %>,
16
+ i_rst_n => <%= register_block.reset %>,
17
+ i_csrbus_valid => <%= valid %>,
18
+ i_csrbus_access => <%= access %>,
19
+ i_csrbus_address => <%= address %>,
20
+ i_csrbus_write_data => <%= write_data %>,
21
+ i_csrbus_strobe => <%= strobe %>,
22
+ o_csrbus_ready => <%= ready %>,
23
+ o_csrbus_status => <%= status %>,
24
+ o_csrbus_read_data => <%= read_data %>,
25
+ o_register_valid => <%= register_block.register_valid %>,
26
+ o_register_access => <%= register_block.register_access %>,
27
+ o_register_address => <%= register_block.register_address %>,
28
+ o_register_write_data => <%= register_block.register_write_data %>,
29
+ o_register_strobe => <%= register_block.register_strobe %>,
30
+ i_register_active => <%= register_block.register_active %>,
31
+ i_register_ready => <%= register_block.register_ready %>,
32
+ i_register_status => <%= register_block.register_status %>,
33
+ i_register_read_data => <%= register_block.register_read_data %>
34
+ );
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:register_block, :protocol, :native) do
4
+ vhdl do
5
+ build do
6
+ generic :strobe_width, {
7
+ name: 'STROBE_WIDTH', type: :positive, default: bus_width / 8
8
+ }
9
+
10
+ input :valid, { name: 'i_csrbus_valid' }
11
+ input :access, { name: 'i_csrbus_access', width: 2 }
12
+ input :address, { name: 'i_csrbus_address', width: address_width }
13
+ input :write_data, { name: 'i_csrbus_write_data', width: bus_width }
14
+ input :strobe, { name: 'i_csrbus_strobe', width: strobe_width }
15
+ output :ready, { name: 'o_csrbus_ready' }
16
+ output :status, { name: 'o_csrbus_status', width: 2 }
17
+ output :read_data, { name: 'o_csrbus_read_data', width: bus_width }
18
+ end
19
+
20
+ main_code :register_block, from_template: true
21
+ end
22
+ end
@@ -30,7 +30,7 @@ RgGen.define_list_feature(:register_block, :protocol) do
30
30
  end
31
31
 
32
32
  def bus_width
33
- configuration.bus_width
33
+ register_block.bus_width
34
34
  end
35
35
 
36
36
  def local_address_width
@@ -47,8 +47,8 @@ RgGen.define_list_feature(:register_block, :protocol) do
47
47
  end
48
48
 
49
49
  factory do
50
- def target_feature_key(configuration, _register_block)
51
- configuration.protocol
50
+ def target_feature_key(_configuration, register_block)
51
+ register_block.protocol
52
52
  end
53
53
  end
54
54
  end
@@ -59,7 +59,7 @@ RgGen.define_simple_feature(:register_block, :vhdl_top) do
59
59
  end
60
60
 
61
61
  def bus_width
62
- configuration.bus_width
62
+ register_block.bus_width
63
63
  end
64
64
 
65
65
  def value_width
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ module RgGen
4
+ module VHDL
5
+ module RegisterMap
6
+ module KeywordChecker
7
+ VHDL_KEYWORDS = [
8
+ 'abs', 'access', 'after', 'alias', 'all', 'and', 'architecture', 'array',
9
+ 'assert', 'assume', 'attribute', 'begin', 'block', 'body', 'buffer', 'bus',
10
+ 'case', 'component', 'configuration', 'constant', 'context', 'cover', 'default',
11
+ 'disconnect', 'downto', 'else', 'elsif', 'end', 'entity', 'exit', 'fairness',
12
+ 'file', 'for', 'force', 'function', 'generate', 'generic', 'group', 'guarded',
13
+ 'if', 'impure', 'in', 'inertial', 'inout', 'is', 'label', 'library', 'linkage',
14
+ 'literal', 'loop', 'map', 'mod', 'nand', 'new', 'next', 'nor', 'not', 'null',
15
+ 'of', 'on', 'open', 'or', 'others', 'out', 'package', 'parameter', 'port',
16
+ 'postponed', 'procedure', 'process', 'property', 'protected', 'private', 'pure',
17
+ 'range', 'record', 'register', 'reject', 'release', 'rem', 'report', 'restrict',
18
+ 'return', 'rol', 'ror', 'select', 'sequence', 'severity', 'signal', 'shared',
19
+ 'sla', 'sll', 'sra', 'srl', 'strong', 'subtype', 'then', 'to', 'transport',
20
+ 'type', 'unaffected', 'units', 'until', 'use', 'variable', 'view', 'vpkg',
21
+ 'vmode', 'vprop', 'vunit', 'wait', 'when', 'while', 'with', 'xnor', 'xor'
22
+ ].freeze
23
+
24
+ def self.included(klass)
25
+ klass.class_eval do
26
+ verify(:feature, prepend: true) do
27
+ error_condition do
28
+ @name && VHDL_KEYWORDS.any? { |kw| kw.casecmp?(@name) }
29
+ end
30
+ message do
31
+ layer_name = component.layer.to_s.sub('_', ' ')
32
+ "vhdl keyword is not allowed for #{layer_name} name: #{@name.downcase}"
33
+ end
34
+ end
35
+ end
36
+ end
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,9 @@
1
+ # frozen_string_literal: true
2
+
3
+ [:register_block, :register_file, :register, :bit_field].each do |layer|
4
+ RgGen.modify_simple_feature(layer, :name) do
5
+ register_map do
6
+ include RgGen::VHDL::RegisterMap::KeywordChecker
7
+ end
8
+ end
9
+ end
@@ -24,8 +24,8 @@ module RgGen
24
24
  expression
25
25
  end
26
26
 
27
- def local_scope(scope_name, attributes = {}, &block)
28
- LocalScope.new(attributes.merge(name: scope_name), &block).to_code
27
+ def local_scope(scope_name, attributes = {}, &)
28
+ LocalScope.new(attributes.merge(name: scope_name), &).to_code
29
29
  end
30
30
  end
31
31
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module VHDL
5
- VERSION = '0.10.1'
5
+ VERSION = '0.11.0'
6
6
  end
7
7
  end
data/lib/rggen/vhdl.rb CHANGED
@@ -9,6 +9,7 @@ require_relative 'vhdl/utility'
9
9
  require_relative 'vhdl/component'
10
10
  require_relative 'vhdl/feature'
11
11
  require_relative 'vhdl/factories'
12
+ require_relative 'vhdl/register_map/keyword_checker'
12
13
 
13
14
  RgGen.setup_plugin :'rggen-vhdl' do |plugin|
14
15
  plugin.version RgGen::VHDL::VERSION
@@ -27,6 +28,7 @@ RgGen.setup_plugin :'rggen-vhdl' do |plugin|
27
28
  'vhdl/register_block/protocol/apb',
28
29
  'vhdl/register_block/protocol/axi4lite',
29
30
  'vhdl/register_block/protocol/wishbone',
31
+ 'vhdl/register_block/protocol/native',
30
32
  'vhdl/register_file/vhdl_top',
31
33
  'vhdl/register/vhdl_top',
32
34
  'vhdl/register/type',
@@ -54,4 +56,8 @@ RgGen.setup_plugin :'rggen-vhdl' do |plugin|
54
56
  'vhdl/bit_field/type/wo_wo1_wotrg',
55
57
  'vhdl/bit_field/type/wrc_wrs'
56
58
  ]
59
+
60
+ plugin.files [
61
+ 'vhdl/register_map/name'
62
+ ]
57
63
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rggen-vhdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.1
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taichi Ishitani
8
- autorequire:
9
8
  bindir: bin
10
9
  cert_chain: []
11
- date: 2024-11-28 00:00:00.000000000 Z
10
+ date: 2025-01-23 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: rggen-systemverilog
@@ -16,14 +15,14 @@ dependencies:
16
15
  requirements:
17
16
  - - ">="
18
17
  - !ruby/object:Gem::Version
19
- version: 0.33.1
18
+ version: 0.34.0
20
19
  type: :runtime
21
20
  prerelease: false
22
21
  version_requirements: !ruby/object:Gem::Requirement
23
22
  requirements:
24
23
  - - ">="
25
24
  - !ruby/object:Gem::Version
26
- version: 0.33.1
25
+ version: 0.34.0
27
26
  description: VHDL writer plugin for RgGen
28
27
  email:
29
28
  - rggen@googlegroups.com
@@ -92,11 +91,15 @@ files:
92
91
  - lib/rggen/vhdl/register_block/protocol/apb.rb
93
92
  - lib/rggen/vhdl/register_block/protocol/axi4lite.erb
94
93
  - lib/rggen/vhdl/register_block/protocol/axi4lite.rb
94
+ - lib/rggen/vhdl/register_block/protocol/native.erb
95
+ - lib/rggen/vhdl/register_block/protocol/native.rb
95
96
  - lib/rggen/vhdl/register_block/protocol/wishbone.erb
96
97
  - lib/rggen/vhdl/register_block/protocol/wishbone.rb
97
98
  - lib/rggen/vhdl/register_block/vhdl_top.erb
98
99
  - lib/rggen/vhdl/register_block/vhdl_top.rb
99
100
  - lib/rggen/vhdl/register_file/vhdl_top.rb
101
+ - lib/rggen/vhdl/register_map/keyword_checker.rb
102
+ - lib/rggen/vhdl/register_map/name.rb
100
103
  - lib/rggen/vhdl/utility.rb
101
104
  - lib/rggen/vhdl/utility/data_object.rb
102
105
  - lib/rggen/vhdl/utility/identifier.rb
@@ -111,7 +114,6 @@ metadata:
111
114
  rubygems_mfa_required: 'true'
112
115
  source_code_uri: https://github.com/rggen/rggen-vhdl
113
116
  wiki_uri: https://github.com/rggen/rggen/wiki
114
- post_install_message:
115
117
  rdoc_options: []
116
118
  require_paths:
117
119
  - lib
@@ -119,15 +121,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
119
121
  requirements:
120
122
  - - ">="
121
123
  - !ruby/object:Gem::Version
122
- version: 3.0.0
124
+ version: '3.1'
123
125
  required_rubygems_version: !ruby/object:Gem::Requirement
124
126
  requirements:
125
127
  - - ">="
126
128
  - !ruby/object:Gem::Version
127
129
  version: '0'
128
130
  requirements: []
129
- rubygems_version: 3.5.16
130
- signing_key:
131
+ rubygems_version: 3.6.2
131
132
  specification_version: 4
132
- summary: rggen-vhdl-0.10.1
133
+ summary: rggen-vhdl-0.11.0
133
134
  test_files: []