{"id":957,"date":"2015-11-13T15:47:01","date_gmt":"2015-11-13T15:47:01","guid":{"rendered":"http:\/\/coolt.ch\/notizen\/?p=957"},"modified":"2015-11-14T10:14:31","modified_gmt":"2015-11-14T10:14:31","slug":"vhdl-array-aus-struct","status":"publish","type":"post","link":"https:\/\/coolt.ch\/notizen\/vhdl-array-aus-struct\/","title":{"rendered":"vhdl:  array aus struct"},"content":{"rendered":"<p><strong>Array aus struct<\/strong><\/p>\n<ul>\n<li>token structure:<br \/>\ncmd | 4 x midi_data (note + velocity) |\u00a0 numb_notes<\/li>\n<li>aus den Token wird ein Array gebildet<\/li>\n<\/ul>\n<pre class=\"lang:sh decode:true\">token_array()\r\n.    token_line_1\r\n.           command\r\n.           midi_data\r\n.                  note\r\n.                  velocity\r\n.            token_number\r\n.     token_line_2<\/pre>\n<ol>\n<li>Midi-Data Struktur bilden<\/li>\n<\/ol>\n<pre class=\"lang:sh decode:true\">-- define midi_data\r\ntype <strong>t_midi_data<\/strong> is record\r\n            note : std_logic_vector(7 downto 0);\r\n            velocity : std_logic_vector(7 downto 0);\r\n        end record;\r\n\r\n-- initialise (if needed)\r\nvariable data_1: t_midi_data;<\/pre>\n<p>2. Array f\u00fcr Midi-Data (weil es 4 x vorkommt)<\/p>\n<pre class=\"lang:sh decode:true\">-- define\r\ntype <strong>t_midi_data_array<\/strong> is <strong>array (3 downto 0)<\/strong> of t_midi_data;\r\n\r\n-- initalise (if needed)\r\nsignal data_array: t_midi_data_array;<\/pre>\n<p>3. Ganze Token Struktur zusammensetzen<\/p>\n<pre class=\"lang:sh decode:true\">-- define\r\ntype <strong>t_token<\/strong> is record\r\n      token_cmd : string(1 to 5);\r\n      token_midi_data : t_midi_data_array;\r\n       token_number : std_logic_vector(3 downto 0);\r\nend record;\r\n\r\n-- initialize (if needed)\r\nsignal token_linie: t_token;<\/pre>\n<p>4. Mehrere Token zu einem Array zusammenfassen<\/p>\n<pre class=\"lang:sh decode:true\">CONSTANT NUMBR_INPUTLINES: natural := 8;\r\n\r\n-- define\r\ntype <strong>t_token_array<\/strong> is array( NUMBR_INPUTLINES-1 downto 0)  of t_token;\r\n\r\n-- initialise\r\nsignal token_array_input: t_token_array;<\/pre>\n<p>&nbsp;<\/p>\n<p><em>Grunds\u00e4tzlich braucht es keine Signale, da die Inputs direkt in input-array eingelesen werden und Zuweisungen direkt vom Array an das entsprechende Signal gegeben wird. <\/em><br \/>\n<em>Einziges Signal das es braucht ist \u00fcber das Gesamt-Array, damit es angesprochen werden kann.<\/em><\/p>\n<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<\/p>\n<p><strong>Werte zuweisen<\/strong><\/p>\n<pre class=\"lang:sh decode:true\">t_token_array()\r\n.    token_line_1\r\n.           command\r\n.           midi_data\r\n.                  note\r\n.                  velocity\r\n.            token_number\r\n.     token_line_2\r\n\r\n-- <strong>initialisation<\/strong>\r\nsignal <strong>s_input_array<\/strong>: t_token_array;<\/pre>\n<pre class=\"lang:sh decode:true \">s_token_line_1 &lt;= s_input_array(0);\r\n\r\ns_token_command &lt;= s_input_array(0).command;\r\n\r\ns_token_note_1 &lt;= s_input_array(0).midi_data(1).note;\r\ns_tk_velocity_1 &lt;= s_input_array(0).m_data(1).vlcty;\r\ns_token_note_2 &lt;= s_input_array(0).midi_data(2).note;\r\ns_tk_velocity_2 &lt;= s_input_array(0).m_data(2).vlcty;\r\n\r\ns_token_number &lt;= s_input_array(0);<\/pre>\n<p>&nbsp;<\/p>\n<p>Die einzelnen Variablen werden mit dem<strong> Namen angesprochen<\/strong>.<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&#8230;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Array aus struct token structure: cmd | 4 x midi_data (note + velocity) |\u00a0 numb_notes aus den Token wird ein Array gebildet token_array() . token_line_1 . command . midi_data . note . velocity . token_number . token_line_2 Midi-Data Struktur bilden &#8212; define midi_data type t_midi_data is record note : std_logic_vector(7 downto 0); velocity : std_logic_vector(7 &hellip; <a href=\"https:\/\/coolt.ch\/notizen\/vhdl-array-aus-struct\/\" class=\"more-link\"><span class=\"screen-reader-text\">vhdl:  array aus struct<\/span> weiterlesen<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[59],"tags":[18,11,10,74],"_links":{"self":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/957"}],"collection":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/comments?post=957"}],"version-history":[{"count":5,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/957\/revisions"}],"predecessor-version":[{"id":961,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/posts\/957\/revisions\/961"}],"wp:attachment":[{"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/media?parent=957"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/categories?post=957"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/coolt.ch\/notizen\/wp-json\/wp\/v2\/tags?post=957"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}