rggen-vhdl 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/LICENSE +1 -1
  3. data/README.md +3 -2
  4. data/lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.erb +2 -0
  5. data/lib/rggen/vhdl/bit_field/type/{ro.erb → ro_rotrg.erb} +8 -4
  6. data/lib/rggen/vhdl/bit_field/type/ro_rotrg.rb +34 -0
  7. data/lib/rggen/vhdl/bit_field/type/rof.erb +5 -2
  8. data/lib/rggen/vhdl/bit_field/type/row0trg_row1trg.erb +18 -0
  9. data/lib/rggen/vhdl/bit_field/type/{ro.rb → row0trg_row1trg.rb} +9 -2
  10. data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb +28 -0
  11. data/lib/rggen/vhdl/bit_field/type/rowo_rowotrg.rb +44 -0
  12. data/lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.erb +2 -0
  13. data/lib/rggen/vhdl/bit_field/type/{rw_w1_wo_wo1.erb → rw_rwtrg_w1.erb} +4 -2
  14. data/lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.rb +39 -0
  15. data/lib/rggen/vhdl/bit_field/type/rwc.erb +2 -0
  16. data/lib/rggen/vhdl/bit_field/type/rwe_rwl.erb +2 -0
  17. data/lib/rggen/vhdl/bit_field/type/rws.erb +2 -0
  18. data/lib/rggen/vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc.erb +2 -0
  19. data/lib/rggen/vhdl/bit_field/type/w0t_w1t.erb +2 -0
  20. data/lib/rggen/vhdl/bit_field/type/w0trg_w1trg.erb +1 -0
  21. data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.erb +29 -0
  22. data/lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.rb +32 -0
  23. data/lib/rggen/vhdl/bit_field/type/wrc_wrs.erb +2 -0
  24. data/lib/rggen/vhdl/feature.rb +1 -1
  25. data/lib/rggen/vhdl/register/tie_off_unused_signals.erb +6 -0
  26. data/lib/rggen/vhdl/register/type/default.erb +0 -1
  27. data/lib/rggen/vhdl/register/type/indirect.erb +0 -1
  28. data/lib/rggen/vhdl/register/type/indirect.rb +1 -1
  29. data/lib/rggen/vhdl/register/type.rb +5 -0
  30. data/lib/rggen/vhdl/register_block/protocol/wishbone.erb +36 -0
  31. data/lib/rggen/vhdl/register_block/protocol/wishbone.rb +25 -0
  32. data/lib/rggen/vhdl/utility.rb +2 -2
  33. data/lib/rggen/vhdl/version.rb +1 -1
  34. data/lib/rggen/vhdl.rb +37 -35
  35. metadata +22 -14
  36. data/lib/rggen/vhdl/bit_field/type/rw_w1_wo_wo1.rb +0 -23
  37. data/lib/rggen/vhdl/register/default.erb +0 -29
  38. data/lib/rggen/vhdl/setup.rb +0 -11
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 06a1c6755b2a8f179607870c8d2d5a24b770008fce59619c3cdad8364da46161
4
- data.tar.gz: 42961741bd866c5e5ed2e4d3e99026214e6dfa499919abda73c3f882b55196f7
3
+ metadata.gz: a3fe2a4f117ebddd32c38f4e65d042c845f81e85f6130d7f85ebf94f7b12868f
4
+ data.tar.gz: 55c35ac2e82232c2fba80da4ec23ad0bb417cb35c228b3e94a76ee134f747f54
5
5
  SHA512:
6
- metadata.gz: 97ea8805f99296c3cabd602164a3c919d54fbb7b19d66685884ce7da31987d14001d944f2e1856216bd059e1d3fa09945532b357e27f7fd22378f8f6633c9c63
7
- data.tar.gz: 1cccbac061bd475c8a2af1f9c569c59269274ff91b41da806e77ccc94429c113bdd169f7a668777409e1a127e934bcc76fcdb1689f75b6388c75840eb833f589
6
+ metadata.gz: 1e1d50c4f6eea7cfd80de27beac4e2f451d8913d13b77976776e0c021252dc53da2aa1227ed5b587f905d30aa54d66437e4af795bc15cea9626f8a7076bc521f
7
+ data.tar.gz: 0fa49c35d10ddfe2c4d680780dd3f40ef0a8dc64aa4808cc352c55261ccf9d8d754aa450643bdacf1072b86f88ce880050851afcf09001a091ea25f0439353e3
data/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2021 Taichi Ishitani
3
+ Copyright (c) 2021 - 2022 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
@@ -60,14 +60,15 @@ $ simulator \
60
60
 
61
61
  Feedbacks, bus reports, questions and etc. are welcome! You can post them bu using following ways:
62
62
 
63
- * [GitHub Issue Tracker](https://github.com/rggen/rggen-vhdl/issues)
63
+ * [GitHub Issue Tracker](https://github.com/rggen/rggen/issues)
64
+ * [GitHub Discussions](https://github.com/rggen/rggen/discussions)
64
65
  * [Chat Room](https://gitter.im/rggen/rggen)
65
66
  * [Mailing List](https://groups.google.com/d/forum/rggen)
66
67
  * [Mail](mailto:rggen@googlegroups.com)
67
68
 
68
69
  ## Copyright & License
69
70
 
70
- Copyright © 2021 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
71
+ Copyright © 2021 - 2022 Taichi Ishitani. RgGen::VHDL is licensed under the [MIT License](https://opensource.org/licenses/MIT), see [LICENSE](LICENSE) for futher details.
71
72
 
72
73
  ## Code of Conduct
73
74
 
@@ -16,6 +16,8 @@ u_bit_field: entity work.rggen_bit_field
16
16
  i_sw_write_data => <%= bit_field_write_data %>,
17
17
  o_sw_read_data => <%= bit_field_read_data %>,
18
18
  o_sw_value => <%= bit_field_value %>,
19
+ o_write_trigger => open,
20
+ o_read_trigger => open,
19
21
  i_hw_write_enable => "0",
20
22
  i_hw_write_data => (others => '0'),
21
23
  i_hw_set => <%= set[loop_variables] %>,
@@ -1,11 +1,13 @@
1
1
  u_bit_field: entity work.rggen_bit_field
2
2
  generic map (
3
- WIDTH => <%= width %>,
4
- STORAGE => false
3
+ WIDTH => <%= width %>,
4
+ STORAGE => false,
5
+ EXTERNAL_READ_DATA => true,
6
+ TRIGGER => <%= rotrg? %>
5
7
  )
6
8
  port map (
7
- i_clk => '0',
8
- i_rst_n => '0',
9
+ i_clk => <%= clock %>,
10
+ i_rst_n => <%= reset %>,
9
11
  i_sw_valid => <%= bit_field_valid %>,
10
12
  i_sw_read_mask => <%= bit_field_read_mask %>,
11
13
  i_sw_write_enable => "0",
@@ -13,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
13
15
  i_sw_write_data => <%= bit_field_write_data %>,
14
16
  o_sw_read_data => <%= bit_field_read_data %>,
15
17
  o_sw_value => <%= bit_field_value %>,
18
+ o_write_trigger => open,
19
+ o_read_trigger => <%= read_trigger_signal %>,
16
20
  i_hw_write_enable => "0",
17
21
  i_hw_write_data => (others => '0'),
18
22
  i_hw_set => (others => '0'),
@@ -0,0 +1,34 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:ro, :rotrg]) do
4
+ vhdl do
5
+ build do
6
+ unless bit_field.reference?
7
+ input :value_in, {
8
+ name: "i_#{full_name}", width: width, array_size: array_size
9
+ }
10
+ end
11
+ if rotrg?
12
+ output :read_trigger, {
13
+ name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
14
+ }
15
+ end
16
+ end
17
+
18
+ main_code :bit_field, from_template: true
19
+
20
+ private
21
+
22
+ def rotrg?
23
+ bit_field.type == :rotrg
24
+ end
25
+
26
+ def read_trigger_signal
27
+ rotrg? && read_trigger[loop_variables] || 'open'
28
+ end
29
+
30
+ def reference_or_value_in
31
+ reference_bit_field || value_in[loop_variables]
32
+ end
33
+ end
34
+ end
@@ -1,7 +1,8 @@
1
1
  u_bit_field: entity work.rggen_bit_field
2
2
  generic map (
3
- WIDTH => <%= width %>,
4
- STORAGE => false
3
+ WIDTH => <%= width %>,
4
+ STORAGE => false,
5
+ EXTERNAL_READ_DATA => true
5
6
  )
6
7
  port map (
7
8
  i_clk => '0',
@@ -13,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
13
14
  i_sw_write_data => <%= bit_field_write_data %>,
14
15
  o_sw_read_data => <%= bit_field_read_data %>,
15
16
  o_sw_value => <%= bit_field_value %>,
17
+ o_write_trigger => open,
18
+ o_read_trigger => open,
16
19
  i_hw_write_enable => "0",
17
20
  i_hw_write_data => (others => '0'),
18
21
  i_hw_set => (others => '0'),
@@ -0,0 +1,18 @@
1
+ u_bit_field: entity work.rggen_bit_field_w01trg
2
+ generic map (
3
+ WRITE_ONE_TRIGGER => <%= write_one_trigger? %>,
4
+ WIDTH => <%= width %>
5
+ )
6
+ port map (
7
+ i_clk => i_clk,
8
+ i_rst_n => i_rst_n,
9
+ i_sw_valid => <%= bit_field_valid %>,
10
+ i_sw_read_mask => <%= bit_field_read_mask %>,
11
+ i_sw_write_enable => "1",
12
+ i_sw_write_mask => <%= bit_field_write_mask %>,
13
+ i_sw_write_data => <%= bit_field_write_data %>,
14
+ o_sw_read_data => <%= bit_field_read_data %>,
15
+ o_sw_value => <%= bit_field_value %>,
16
+ i_value => <%= reference_or_value_in %>,
17
+ o_trigger => <%= trigger[loop_variables] %>
18
+ );
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- RgGen.define_list_item_feature(:bit_field, :type, :ro) do
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:row0trg, :row1trg]) do
4
4
  vhdl do
5
5
  build do
6
6
  unless bit_field.reference?
@@ -8,14 +8,21 @@ RgGen.define_list_item_feature(:bit_field, :type, :ro) do
8
8
  name: "i_#{full_name}", width: width, array_size: array_size
9
9
  }
10
10
  end
11
+ output :trigger, {
12
+ name: "o_#{full_name}_trigger", width: width, array_size: array_size
13
+ }
11
14
  end
12
15
 
13
16
  main_code :bit_field, from_template: true
14
17
 
15
18
  private
16
19
 
20
+ def write_one_trigger?
21
+ bit_field.type == :row1trg
22
+ end
23
+
17
24
  def reference_or_value_in
18
- bit_field.reference? && reference_bit_field || value_in[loop_variables]
25
+ reference_bit_field || value_in[loop_variables]
19
26
  end
20
27
  end
21
28
  end
@@ -0,0 +1,28 @@
1
+ u_bit_field: entity work.rggen_bit_field
2
+ generic map (
3
+ WIDTH => <%= width %>,
4
+ INITIAL_VALUE => <%= initial_value %>,
5
+ EXTERNAL_READ_DATA => true,
6
+ TRIGGER => <%= rowotrg? %>
7
+ )
8
+ port map (
9
+ i_clk => <%= clock %>,
10
+ i_rst_n => <%= reset %>,
11
+ i_sw_valid => <%= bit_field_valid %>,
12
+ i_sw_read_mask => <%= bit_field_read_mask %>,
13
+ i_sw_write_enable => "1",
14
+ i_sw_write_mask => <%= bit_field_write_mask %>,
15
+ i_sw_write_data => <%= bit_field_write_data %>,
16
+ o_sw_read_data => <%= bit_field_read_data %>,
17
+ o_sw_value => <%= bit_field_value %>,
18
+ o_write_trigger => <%= write_trigger_signal %>,
19
+ o_read_trigger => <%= read_trigger_signal %>,
20
+ i_hw_write_enable => "0",
21
+ i_hw_write_data => (others => '0'),
22
+ i_hw_set => (others => '0'),
23
+ i_hw_clear => (others => '0'),
24
+ i_value => <%= reference_or_value_in %>,
25
+ i_mask => (others => '1'),
26
+ o_value => <%= value_out[loop_variables] %>,
27
+ o_value_unmasked => open
28
+ );
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:rowo, :rowotrg]) do
4
+ vhdl do
5
+ build do
6
+ output :value_out, {
7
+ name: "o_#{full_name}", width: width, array_size: array_size
8
+ }
9
+ unless bit_field.reference?
10
+ input :value_in, {
11
+ name: "i_#{full_name}", width: width, array_size: array_size
12
+ }
13
+ end
14
+ if rowotrg?
15
+ output :write_trigger, {
16
+ name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
17
+ }
18
+ output :read_trigger, {
19
+ name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
20
+ }
21
+ end
22
+ end
23
+
24
+ main_code :bit_field, from_template: true
25
+
26
+ private
27
+
28
+ def rowotrg?
29
+ bit_field.type == :rowotrg
30
+ end
31
+
32
+ def write_trigger_signal
33
+ rowotrg? && write_trigger[loop_variables] || 'open'
34
+ end
35
+
36
+ def read_trigger_signal
37
+ rowotrg? && read_trigger[loop_variables] || 'open'
38
+ end
39
+
40
+ def reference_or_value_in
41
+ reference_bit_field || value_in[loop_variables]
42
+ end
43
+ end
44
+ end
@@ -16,6 +16,8 @@ u_bit_field: entity work.rggen_bit_field
16
16
  i_sw_write_data => <%= bit_field_write_data %>,
17
17
  o_sw_read_data => <%= bit_field_read_data %>,
18
18
  o_sw_value => <%= bit_field_value %>,
19
+ o_write_trigger => open,
20
+ o_read_trigger => open,
19
21
  i_hw_write_enable => "0",
20
22
  i_hw_write_data => (others => '0'),
21
23
  i_hw_set => (others => '0'),
@@ -2,8 +2,8 @@ u_bit_field: entity work.rggen_bit_field
2
2
  generic map (
3
3
  WIDTH => <%= width %>,
4
4
  INITIAL_VALUE => <%= initial_value %>,
5
- SW_READ_ACTION => <%= read_action %>,
6
- SW_WRITE_ONCE => <%= write_once %>
5
+ SW_WRITE_ONCE => <%= write_once %>,
6
+ TRIGGER => <%= rwtrg? %>
7
7
  )
8
8
  port map (
9
9
  i_clk => <%= clock %>,
@@ -15,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
15
15
  i_sw_write_data => <%= bit_field_write_data %>,
16
16
  o_sw_read_data => <%= bit_field_read_data %>,
17
17
  o_sw_value => <%= bit_field_value %>,
18
+ o_write_trigger => <%= write_trigger_signal %>,
19
+ o_read_trigger => <%= read_trigger_signal %>,
18
20
  i_hw_write_enable => "0",
19
21
  i_hw_write_data => (others => '0'),
20
22
  i_hw_set => (others => '0'),
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:rw, :rwtrg, :w1]) do
4
+ vhdl do
5
+ build do
6
+ output :value_out, {
7
+ name: "o_#{full_name}", width: width, array_size: array_size
8
+ }
9
+ if rwtrg?
10
+ output :write_trigger, {
11
+ name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
12
+ }
13
+ output :read_trigger, {
14
+ name: "o_#{full_name}_read_trigger", width: 1, array_size: array_size
15
+ }
16
+ end
17
+ end
18
+
19
+ main_code :bit_field, from_template: true
20
+
21
+ private
22
+
23
+ def rwtrg?
24
+ bit_field.type == :rwtrg
25
+ end
26
+
27
+ def write_once
28
+ bit_field.type == :w1
29
+ end
30
+
31
+ def write_trigger_signal
32
+ rwtrg? && write_trigger[loop_variables] || 'open'
33
+ end
34
+
35
+ def read_trigger_signal
36
+ rwtrg? && read_trigger[loop_variables] || 'open'
37
+ end
38
+ end
39
+ end
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
14
14
  i_sw_write_data => <%= bit_field_write_data %>,
15
15
  o_sw_read_data => <%= bit_field_read_data %>,
16
16
  o_sw_value => <%= bit_field_value %>,
17
+ o_write_trigger => open,
18
+ o_read_trigger => open,
17
19
  i_hw_write_enable => "0",
18
20
  i_hw_write_data => (others => '0'),
19
21
  i_hw_set => (others => '0'),
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
14
14
  i_sw_write_data => <%= bit_field_write_data %>,
15
15
  o_sw_read_data => <%= bit_field_read_data %>,
16
16
  o_sw_value => <%= bit_field_value %>,
17
+ o_write_trigger => open,
18
+ o_read_trigger => open,
17
19
  i_hw_write_enable => "0",
18
20
  i_hw_write_data => (others => '0'),
19
21
  i_hw_set => (others => '0'),
@@ -13,6 +13,8 @@ u_bit_field: entity work.rggen_bit_field
13
13
  i_sw_write_data => <%= bit_field_write_data %>,
14
14
  o_sw_read_data => <%= bit_field_read_data %>,
15
15
  o_sw_value => <%= bit_field_value %>,
16
+ o_write_trigger => open,
17
+ o_read_trigger => open,
16
18
  i_hw_write_enable => <%= set_signal %>,
17
19
  i_hw_write_data => <%= value_in[loop_variables] %>,
18
20
  i_hw_set => (others => '0'),
@@ -15,6 +15,8 @@ u_bit_field: entity work.rggen_bit_field
15
15
  i_sw_write_data => <%= bit_field_write_data %>,
16
16
  o_sw_read_data => <%= bit_field_read_data %>,
17
17
  o_sw_value => <%= bit_field_value %>,
18
+ o_write_trigger => open,
19
+ o_read_trigger => open,
18
20
  i_hw_write_enable => "0",
19
21
  i_hw_write_data => (others => '0'),
20
22
  i_hw_set => (others => '0'),
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
14
14
  i_sw_write_data => <%= bit_field_write_data %>,
15
15
  o_sw_read_data => <%= bit_field_read_data %>,
16
16
  o_sw_value => <%= bit_field_value %>,
17
+ o_write_trigger => open,
18
+ o_read_trigger => open,
17
19
  i_hw_write_enable => "0",
18
20
  i_hw_write_data => (others => '0'),
19
21
  i_hw_set => (others => '0'),
@@ -13,5 +13,6 @@ u_bit_field: entity work.rggen_bit_field_w01trg
13
13
  i_sw_write_data => <%= bit_field_write_data %>,
14
14
  o_sw_read_data => <%= bit_field_read_data %>,
15
15
  o_sw_value => <%= bit_field_value %>,
16
+ i_value => (others => '0'),
16
17
  o_trigger => <%= trigger[loop_variables] %>
17
18
  );
@@ -0,0 +1,29 @@
1
+ u_bit_field: entity work.rggen_bit_field
2
+ generic map (
3
+ WIDTH => <%= width %>,
4
+ INITIAL_VALUE => <%= initial_value %>,
5
+ SW_READ_ACTION => RGGEN_READ_NONE,
6
+ SW_WRITE_ONCE => <%= write_once %>,
7
+ TRIGGER => <%= wotrg? %>
8
+ )
9
+ port map (
10
+ i_clk => <%= clock %>,
11
+ i_rst_n => <%= reset %>,
12
+ i_sw_valid => <%= bit_field_valid %>,
13
+ i_sw_read_mask => <%= bit_field_read_mask %>,
14
+ i_sw_write_enable => "1",
15
+ i_sw_write_mask => <%= bit_field_write_mask %>,
16
+ i_sw_write_data => <%= bit_field_write_data %>,
17
+ o_sw_read_data => <%= bit_field_read_data %>,
18
+ o_sw_value => <%= bit_field_value %>,
19
+ o_write_trigger => <%= write_trigger_signal %>,
20
+ o_read_trigger => open,
21
+ i_hw_write_enable => "0",
22
+ i_hw_write_data => (others => '0'),
23
+ i_hw_set => (others => '0'),
24
+ i_hw_clear => (others => '0'),
25
+ i_value => (others => '0'),
26
+ i_mask => (others => '1'),
27
+ o_value => <%= value_out[loop_variables] %>,
28
+ o_value_unmasked => open
29
+ );
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:bit_field, :type, [:wo, :wo1, :wotrg]) do
4
+ vhdl do
5
+ build do
6
+ output :value_out, {
7
+ name: "o_#{full_name}", width: width, array_size: array_size
8
+ }
9
+ if wotrg?
10
+ output :write_trigger, {
11
+ name: "o_#{full_name}_write_trigger", width: 1, array_size: array_size
12
+ }
13
+ end
14
+ end
15
+
16
+ main_code :bit_field, from_template: true
17
+
18
+ private
19
+
20
+ def wotrg?
21
+ bit_field.type == :wotrg
22
+ end
23
+
24
+ def write_once
25
+ bit_field.type == :wo1
26
+ end
27
+
28
+ def write_trigger_signal
29
+ wotrg? && write_trigger[loop_variables] || 'open'
30
+ end
31
+ end
32
+ end
@@ -14,6 +14,8 @@ u_bit_field: entity work.rggen_bit_field
14
14
  i_sw_write_data => <%= bit_field_write_data %>,
15
15
  o_sw_read_data => <%= bit_field_read_data %>,
16
16
  o_sw_value => <%= bit_field_value %>,
17
+ o_write_trigger => open,
18
+ o_read_trigger => open,
17
19
  i_hw_write_enable => "0",
18
20
  i_hw_write_data => (others => '0'),
19
21
  i_hw_set => (others => '0'),
@@ -14,7 +14,7 @@ module RgGen
14
14
  def create_port(direction, attributes, &block)
15
15
  attributes =
16
16
  attributes
17
- .merge(direction: { input: :in, output: :out}[direction])
17
+ .merge(direction: { input: :in, output: :out }[direction])
18
18
  DataObject.new(:port, attributes, &block)
19
19
  end
20
20
 
@@ -0,0 +1,6 @@
1
+ \g_tie_off\: for \__i\ in 0 to <%= width - 1 %> generate
2
+ g: if (bit_slice(<%= valid_bits %>, \__i\) = '0') generate
3
+ <%= bit_field_read_data %>(\__i\) <= '0';
4
+ <%= bit_field_value %>(\__i\) <= '0';
5
+ end generate;
6
+ end generate;
@@ -6,7 +6,6 @@ u_register: entity work.rggen_default_register
6
6
  OFFSET_ADDRESS => <%= offset_address %>,
7
7
  BUS_WIDTH => <%= bus_width %>,
8
8
  DATA_WIDTH => <%= width %>,
9
- VALID_BITS => <%= valid_bits %>,
10
9
  REGISTER_INDEX => <%= register_index %>
11
10
  )
12
11
  port map (
@@ -9,7 +9,6 @@ u_register: entity work.rggen_indirect_register
9
9
  OFFSET_ADDRESS => <%= offset_address %>,
10
10
  BUS_WIDTH => <%= bus_width %>,
11
11
  DATA_WIDTH => <%= width %>,
12
- VALID_BITS => <%= valid_bits %>,
13
12
  INDIRECT_MATCH_WIDTH => <%= match_width %>
14
13
  )
15
14
  port map (
@@ -3,7 +3,7 @@
3
3
  RgGen.define_list_item_feature(:register, :type, :indirect) do
4
4
  vhdl do
5
5
  build do
6
- signal :indirect_match, { width: match_width }
6
+ signal :indirect_match, { width: match_width }
7
7
  end
8
8
 
9
9
  main_code :register, from_template: true
@@ -5,6 +5,11 @@ RgGen.define_list_feature(:register, :type) do
5
5
  base_feature do
6
6
  include RgGen::SystemVerilog::RTL::RegisterType
7
7
 
8
+ pre_code :register do |code|
9
+ register.bit_fields.empty? ||
10
+ (code << process_template(File.join(__dir__, 'tie_off_unused_signals.erb')))
11
+ end
12
+
8
13
  private
9
14
 
10
15
  def readable?
@@ -0,0 +1,36 @@
1
+ u_adapter: entity work.rggen_wishbone_adapter
2
+ generic map (
3
+ ADDRESS_WIDTH => <%= address_width %>,
4
+ LOCAL_ADDRESS_WIDTH => <%= local_address_width %>,
5
+ BUS_WIDTH => <%= bus_width %>,
6
+ REGISTERS => <%= total_registers %>,
7
+ PRE_DECODE => <%= pre_decode %>,
8
+ BASE_ADDRESS => <%= base_address %>,
9
+ BYTE_SIZE => <%= byte_size %>,
10
+ ERROR_STATUS => <%= error_status %>,
11
+ USE_STALL => <%= use_stall %>
12
+ )
13
+ port map (
14
+ i_clk => <%= register_block.clock %>,
15
+ i_rst_n => <%= register_block.reset %>,
16
+ i_wb_cyc => <%= wb_cyc %>,
17
+ i_wb_stb => <%= wb_stb %>,
18
+ o_wb_stall => <%= wb_stall %>,
19
+ i_wb_adr => <%= wb_adr %>,
20
+ i_wb_we => <%= wb_we %>,
21
+ i_wb_dat => <%= wb_dat_i %>,
22
+ i_wb_sel => <%= wb_sel %>,
23
+ o_wb_ack => <%= wb_ack %>,
24
+ o_wb_err => <%= wb_err %>,
25
+ o_wb_rty => <%= wb_rty %>,
26
+ o_wb_dat => <%= wb_dat_o %>,
27
+ o_register_valid => <%= register_block.register_valid %>,
28
+ o_register_access => <%= register_block.register_access %>,
29
+ o_register_address => <%= register_block.register_address %>,
30
+ o_register_write_data => <%= register_block.register_write_data %>,
31
+ o_register_strobe => <%= register_block.register_strobe %>,
32
+ i_register_active => <%= register_block.register_active %>,
33
+ i_register_ready => <%= register_block.register_ready %>,
34
+ i_register_status => <%= register_block.register_status %>,
35
+ i_register_read_data => <%= register_block.register_read_data %>
36
+ );
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ RgGen.define_list_item_feature(:register_block, :protocol, :wishbone) do
4
+ vhdl do
5
+ build do
6
+ generic :use_stall, {
7
+ name: 'USE_STALL', type: :boolean, default: true
8
+ }
9
+
10
+ input :wb_cyc, { name: 'i_wb_cyc' }
11
+ input :wb_stb, { name: 'i_wb_stb' }
12
+ output :wb_stall, { name: 'o_wb_stall' }
13
+ input :wb_adr, { name: 'i_wb_adr', width: address_width }
14
+ input :wb_we, { name: 'i_wb_we' }
15
+ input :wb_dat_i, { name: 'i_wb_dat', width: bus_width }
16
+ input :wb_sel, { name: 'i_wb_sel', width: bus_width / 8 }
17
+ output :wb_ack, { name: 'o_wb_ack' }
18
+ output :wb_err, { name: 'o_wb_err' }
19
+ output :wb_rty, { name: 'o_wb_rty' }
20
+ output :wb_dat_o, { name: 'o_wb_dat', width: bus_width }
21
+ end
22
+
23
+ main_code :register_block, from_template: true
24
+ end
25
+ end
@@ -12,12 +12,12 @@ module RgGen
12
12
  end
13
13
 
14
14
  def bin(value, width = nil)
15
- width && format("\"%0*b\"", width, value) || "'#{value[0]}'"
15
+ width && format('"%0*b"', width, value) || "'#{value[0]}'"
16
16
  end
17
17
 
18
18
  def hex(value, width)
19
19
  print_width = (width + 3) / 4
20
- format("x\"%0*x\"", print_width, value)
20
+ format('x"%0*x"', print_width, value)
21
21
  end
22
22
 
23
23
  def local_scope(scope_name, attributes = {}, &block)
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RgGen
4
4
  module VHDL
5
- VERSION = '0.1.0'
5
+ VERSION = '0.3.0'
6
6
  end
7
7
  end
data/lib/rggen/vhdl.rb CHANGED
@@ -10,41 +10,43 @@ require_relative 'vhdl/component'
10
10
  require_relative 'vhdl/feature'
11
11
  require_relative 'vhdl/factories'
12
12
 
13
- module RgGen
14
- module VHDL
15
- extend Core::Plugin
13
+ RgGen.setup_plugin :'rggen-vhdl' do |plugin|
14
+ plugin.version RgGen::VHDL::VERSION
16
15
 
17
- setup_plugin :'rggen-vhdl' do |plugin|
18
- plugin.register_component :vhdl do
19
- component Component, ComponentFactory
20
- feature Feature, FeatureFactory
21
- end
22
-
23
- plugin.files [
24
- 'vhdl/bit_field/type',
25
- 'vhdl/bit_field/type/rc_w0c_w1c_wc_woc',
26
- 'vhdl/bit_field/type/ro',
27
- 'vhdl/bit_field/type/rof',
28
- 'vhdl/bit_field/type/rs_w0s_w1s_ws_wos',
29
- 'vhdl/bit_field/type/rw_w1_wo_wo1',
30
- 'vhdl/bit_field/type/rwc',
31
- 'vhdl/bit_field/type/rwe_rwl',
32
- 'vhdl/bit_field/type/rws',
33
- 'vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
34
- 'vhdl/bit_field/type/w0t_w1t',
35
- 'vhdl/bit_field/type/w0trg_w1trg',
36
- 'vhdl/bit_field/type/wrc_wrs',
37
- 'vhdl/bit_field/vhdl_top',
38
- 'vhdl/register/type',
39
- 'vhdl/register/type/external',
40
- 'vhdl/register/type/indirect',
41
- 'vhdl/register/vhdl_top',
42
- 'vhdl/register_block/protocol',
43
- 'vhdl/register_block/protocol/apb',
44
- 'vhdl/register_block/protocol/axi4lite',
45
- 'vhdl/register_block/vhdl_top',
46
- 'vhdl/register_file/vhdl_top'
47
- ]
48
- end
16
+ plugin.register_component :vhdl do
17
+ component RgGen::VHDL::Component,
18
+ RgGen::VHDL::ComponentFactory
19
+ feature RgGen::VHDL::Feature,
20
+ RgGen::VHDL::FeatureFactory
49
21
  end
22
+
23
+ plugin.files [
24
+ 'vhdl/register_block/vhdl_top',
25
+ 'vhdl/register_block/protocol',
26
+ 'vhdl/register_block/protocol/apb',
27
+ 'vhdl/register_block/protocol/axi4lite',
28
+ 'vhdl/register_block/protocol/wishbone',
29
+ 'vhdl/register_file/vhdl_top',
30
+ 'vhdl/register/vhdl_top',
31
+ 'vhdl/register/type',
32
+ 'vhdl/register/type/external',
33
+ 'vhdl/register/type/indirect',
34
+ 'vhdl/bit_field/vhdl_top',
35
+ 'vhdl/bit_field/type',
36
+ 'vhdl/bit_field/type/rc_w0c_w1c_wc_woc',
37
+ 'vhdl/bit_field/type/ro_rotrg',
38
+ 'vhdl/bit_field/type/rof',
39
+ 'vhdl/bit_field/type/row0trg_row1trg',
40
+ 'vhdl/bit_field/type/rowo_rowotrg',
41
+ 'vhdl/bit_field/type/rs_w0s_w1s_ws_wos',
42
+ 'vhdl/bit_field/type/rw_rwtrg_w1',
43
+ 'vhdl/bit_field/type/rwc',
44
+ 'vhdl/bit_field/type/rwe_rwl',
45
+ 'vhdl/bit_field/type/rws',
46
+ 'vhdl/bit_field/type/w0crs_w0src_w1crs_w1src_wcrs_wsrc',
47
+ 'vhdl/bit_field/type/w0t_w1t',
48
+ 'vhdl/bit_field/type/w0trg_w1trg',
49
+ 'vhdl/bit_field/type/wo_wo1_wotrg',
50
+ 'vhdl/bit_field/type/wrc_wrs'
51
+ ]
50
52
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rggen-vhdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Taichi Ishitani
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-16 00:00:00.000000000 Z
11
+ date: 2022-07-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rggen-systemverilog
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: 0.25.1
19
+ version: 0.27.0
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.25.1
26
+ version: 0.27.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: bundler
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -52,14 +52,18 @@ files:
52
52
  - lib/rggen/vhdl/bit_field/type.rb
53
53
  - lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.erb
54
54
  - lib/rggen/vhdl/bit_field/type/rc_w0c_w1c_wc_woc.rb
55
- - lib/rggen/vhdl/bit_field/type/ro.erb
56
- - lib/rggen/vhdl/bit_field/type/ro.rb
55
+ - lib/rggen/vhdl/bit_field/type/ro_rotrg.erb
56
+ - lib/rggen/vhdl/bit_field/type/ro_rotrg.rb
57
57
  - lib/rggen/vhdl/bit_field/type/rof.erb
58
58
  - lib/rggen/vhdl/bit_field/type/rof.rb
59
+ - lib/rggen/vhdl/bit_field/type/row0trg_row1trg.erb
60
+ - lib/rggen/vhdl/bit_field/type/row0trg_row1trg.rb
61
+ - lib/rggen/vhdl/bit_field/type/rowo_rowotrg.erb
62
+ - lib/rggen/vhdl/bit_field/type/rowo_rowotrg.rb
59
63
  - lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.erb
60
64
  - lib/rggen/vhdl/bit_field/type/rs_w0s_w1s_ws_wos.rb
61
- - lib/rggen/vhdl/bit_field/type/rw_w1_wo_wo1.erb
62
- - lib/rggen/vhdl/bit_field/type/rw_w1_wo_wo1.rb
65
+ - lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.erb
66
+ - lib/rggen/vhdl/bit_field/type/rw_rwtrg_w1.rb
63
67
  - lib/rggen/vhdl/bit_field/type/rwc.erb
64
68
  - lib/rggen/vhdl/bit_field/type/rwc.rb
65
69
  - lib/rggen/vhdl/bit_field/type/rwe_rwl.erb
@@ -72,13 +76,15 @@ files:
72
76
  - lib/rggen/vhdl/bit_field/type/w0t_w1t.rb
73
77
  - lib/rggen/vhdl/bit_field/type/w0trg_w1trg.erb
74
78
  - lib/rggen/vhdl/bit_field/type/w0trg_w1trg.rb
79
+ - lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.erb
80
+ - lib/rggen/vhdl/bit_field/type/wo_wo1_wotrg.rb
75
81
  - lib/rggen/vhdl/bit_field/type/wrc_wrs.erb
76
82
  - lib/rggen/vhdl/bit_field/type/wrc_wrs.rb
77
83
  - lib/rggen/vhdl/bit_field/vhdl_top.rb
78
84
  - lib/rggen/vhdl/component.rb
79
85
  - lib/rggen/vhdl/factories.rb
80
86
  - lib/rggen/vhdl/feature.rb
81
- - lib/rggen/vhdl/register/default.erb
87
+ - lib/rggen/vhdl/register/tie_off_unused_signals.erb
82
88
  - lib/rggen/vhdl/register/type.rb
83
89
  - lib/rggen/vhdl/register/type/default.erb
84
90
  - lib/rggen/vhdl/register/type/external.erb
@@ -91,10 +97,11 @@ files:
91
97
  - lib/rggen/vhdl/register_block/protocol/apb.rb
92
98
  - lib/rggen/vhdl/register_block/protocol/axi4lite.erb
93
99
  - lib/rggen/vhdl/register_block/protocol/axi4lite.rb
100
+ - lib/rggen/vhdl/register_block/protocol/wishbone.erb
101
+ - lib/rggen/vhdl/register_block/protocol/wishbone.rb
94
102
  - lib/rggen/vhdl/register_block/vhdl_top.erb
95
103
  - lib/rggen/vhdl/register_block/vhdl_top.rb
96
104
  - lib/rggen/vhdl/register_file/vhdl_top.rb
97
- - lib/rggen/vhdl/setup.rb
98
105
  - lib/rggen/vhdl/utility.rb
99
106
  - lib/rggen/vhdl/utility/data_object.rb
100
107
  - lib/rggen/vhdl/utility/identifier.rb
@@ -104,8 +111,9 @@ homepage: https://github.com/rggen/rggen-vhdl
104
111
  licenses:
105
112
  - MIT
106
113
  metadata:
107
- bug_tracker_uri: https://github.com/rggen/rggen-vhdl/issues
114
+ bug_tracker_uri: https://github.com/rggen/rggen/issues
108
115
  mailing_list_uri: https://groups.google.com/d/forum/rggen
116
+ rubygems_mfa_required: 'true'
109
117
  source_code_uri: https://github.com/rggen/rggen-vhdl
110
118
  wiki_uri: https://github.com/rggen/rggen/wiki
111
119
  post_install_message:
@@ -116,15 +124,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
116
124
  requirements:
117
125
  - - ">="
118
126
  - !ruby/object:Gem::Version
119
- version: 2.5.0
127
+ version: 2.6.0
120
128
  required_rubygems_version: !ruby/object:Gem::Requirement
121
129
  requirements:
122
130
  - - ">="
123
131
  - !ruby/object:Gem::Version
124
132
  version: '0'
125
133
  requirements: []
126
- rubygems_version: 3.2.3
134
+ rubygems_version: 3.3.3
127
135
  signing_key:
128
136
  specification_version: 4
129
- summary: rggen-vhdl-0.1.0
137
+ summary: rggen-vhdl-0.3.0
130
138
  test_files: []
@@ -1,23 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- RgGen.define_list_item_feature(:bit_field, :type, [:rw, :w1, :wo, :wo1]) do
4
- vhdl do
5
- build do
6
- output :value_out, {
7
- name: "o_#{full_name}", width: width, array_size: array_size
8
- }
9
- end
10
-
11
- main_code :bit_field, from_template: true
12
-
13
- private
14
-
15
- def read_action
16
- bit_field.readable? && 'RGGEN_READ_DEFAULT' || 'RGGEN_READ_NONE'
17
- end
18
-
19
- def write_once
20
- [:w1, :wo1].include?(bit_field.type)
21
- end
22
- end
23
- end
@@ -1,29 +0,0 @@
1
- rggen_default_register #(
2
- .READABLE (<%= readable %>),
3
- .WRITABLE (<%= writable %>),
4
- .ADDRESS_WIDTH (<%= address_width %>),
5
- .OFFSET_ADDRESS (<%= offset_address %>),
6
- .BUS_WIDTH (<%= bus_width %>),
7
- .DATA_WIDTH (<%= width %>),
8
- .VALID_BITS (<%= valid_bits %>),
9
- .REGISTER_INDEX (<%= register_index %>)
10
- ) u_register (
11
- .i_clk (<%= clock %>),
12
- .i_rst_n (<%= reset %>),
13
- .i_register_valid (<%= register_valid %>),
14
- .i_register_access (<%= register_access %>),
15
- .i_register_address (<%= register_address %>),
16
- .i_register_write_data (<%= register_write_data %>),
17
- .i_register_strobe (<%= register_strobe %>),
18
- .o_register_active (<%= register_active %>),
19
- .o_register_ready (<%= register_ready %>),
20
- .o_register_status (<%= register_status %>),
21
- .o_register_read_data (<%= register_read_data %>),
22
- .o_register_value (<%= register_value %>),
23
- .o_bit_field_valid (<%= bit_field_valid %>),
24
- .o_bit_field_read_mask (<%= bit_field_read_mask %>),
25
- .o_bit_field_write_mask (<%= bit_field_write_mask %>),
26
- .o_bit_field_write_data (<%= bit_field_write_data %>),
27
- .i_bit_field_read_data (<%= bit_field_read_data %>),
28
- .i_bit_field_value (<%= bit_field_value %>)
29
- );
@@ -1,11 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rggen/vhdl'
4
-
5
- RgGen.register_plugin RgGen::VHDL do |builder|
6
- builder.load_plugin 'rggen/systemverilog/rtl/setup'
7
- builder.enable :register_block, [:vhdl_top]
8
- builder.enable :register_file, [:vhdl_top]
9
- builder.enable :register, [:vhdl_top]
10
- builder.enable :bit_field, [:vhdl_top]
11
- end