{"id":151,"date":"2019-09-02T15:00:51","date_gmt":"2019-09-02T15:00:51","guid":{"rendered":"http:\/\/dsd.webs.upv.es\/?page_id=151"},"modified":"2019-09-02T15:00:51","modified_gmt":"2019-09-02T15:00:51","slug":"array-referencing-copying","status":"publish","type":"page","link":"https:\/\/dsd.webs.upv.es\/?page_id=151","title":{"rendered":"Array Referencing &#038; Copying"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Modos de selecci\u00f3n:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Bit-select: selecci\u00f3n de 1 bit<\/li><li>Part-select: selecci\u00f3n de bits contiguos de una \u00fanica dimensi\u00f3n de tipo packed<\/li><li>Slice: selecci\u00f3n de elementos contiguos de un array<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Unpacked arrays<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: verilog; title: ; notranslate\" title=\"\">\nbyte byarr &#x5B;0:15];\t\t\t\/\/ 16 non-contiguous\nbytes byte byarr2 &#x5B;16:1] = byarr;\t\/\/ OK\nlogic b = byarr&#x5B;8]&#x5B;3];\t\t\t\/\/ bit-select: bit 3 of byte 8 byte bysl&#x5B;2] = byarr&#x5B;5:6];\t\t\t\/\/ 2-byte slice \nbyte by8 = byarr&#x5B;8];\t\t\t\/\/ 8-bit slice \nlogic &#x5B;2:0] ps = byarr&#x5B;11]&#x5B;2:0];\t\/\/ part-select\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">Packed arrays<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: verilog; title: ; notranslate\" title=\"\">\nlogic &#x5B;3:0] &#x5B;7:0] data;\t\t\/\/ 32-bit vector with 4 byte subfields\nbit &#x5B;0:31] pdata = data;\t\/\/ 32-bit vector, no subfields\nlogic sign = data&#x5B;3]&#x5B;7];\t\/\/ bit-select\nlogic &#x5B;3:0] nib = data&#x5B;0]&#x5B;7:4];\t\/\/ part-select\nbyte high_byte = data&#x5B;3];\t   \/\/ 8-bit slice\nlogic &#x5B;1:0] &#x5B;7:0] word = data&#x5B;2:1];\t\/\/ 2 byte slices, 2 subfields\nshortint si = data&#x5B;3:2];\t\t\/\/ 16-bit signed integer\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\">  Cuando se accede a un rango de \u00edndices (una porci\u00f3n) de una matriz SystemVerilog, se puede especificar una porci\u00f3n variable usando las notaciones[start+:increment width] y[startt-:decrement width].  El ancho de incremento\/disminuci\u00f3n debe ser una constante. <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: verilog; title: ; notranslate\" title=\"\">\nbit signed &#x5B;31:0] busA &#x5B;7:0]; \/\/ unpacked array of 8 32-bit vectors\nint busB &#x5B;1:0];               \/\/ unpacked array of 2 integers\nbusB = busA&#x5B;7:6];             \/\/ select a 2-vector slice from busA\nbusB = busA&#x5B;6+:2];            \/\/ equivalent to busA&#x5B;7:6]; \nbusB = busA&#x5B;6-:2];            \/\/ equivalent to busA&#x5B;6:5]; \n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>Modos de selecci\u00f3n: Bit-select: selecci\u00f3n de 1 bit Part-select: selecci\u00f3n de bits contiguos de una \u00fanica dimensi\u00f3n de tipo packed Slice: selecci\u00f3n de elementos contiguos de un array Unpacked arrays Packed arrays Cuando se accede a un rango de \u00edndices (una porci\u00f3n) de una matriz SystemVerilog, se puede especificar una porci\u00f3n variable usando las notaciones[start+:increment width] y[startt-:decrement width]. El ancho de incremento\/disminuci\u00f3n debe ser una constante.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":59,"menu_order":7,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-151","page","type-page","status-publish","hentry"],"featured_image_src":null,"_links":{"self":[{"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/pages\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=151"}],"version-history":[{"count":3,"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/pages\/151\/revisions"}],"predecessor-version":[{"id":154,"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/pages\/151\/revisions\/154"}],"up":[{"embeddable":true,"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=\/wp\/v2\/pages\/59"}],"wp:attachment":[{"href":"https:\/\/dsd.webs.upv.es\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}