je la fonction suivante:systemVeilog passe - tableau de taille inconnue
function void foo_arr_bit (int seed, ref bit [*] mem, string mem_name);
for (int i=0; i< mem.size(); i++)
mem[i] = my_randomize_int(seed, mem[i], mem_name);
endfunction: foo_arr_bit
-je appeler la fonction par:
foo_arr_bit(seed, data_bit, "data_bit");
Où data_bit peut être: bit [1: 0]/bit [2: 0]/bit [3: 0]/bit [4: 0]/bit [5: 0] etc ...
Lorsque j'essaie de compiler j'ai l'erreur suivante: près de "[": erreur de syntaxe, inattendue [, attend IDENTIFIER ou TYPE_IDENTIFIER ou NETTYPE_IDENTIFIER.
mon entrée est un tableau condensé, non découplé. – sara8d
Systemverilog ne dispose pas de tableaux dynamiques. L'utilisation d'une classe paramétrable pour encapsuler votre fonction pourrait être une solution. Plus sur cela ici: http://forums.accellera.org/topic/1177-how-to-pass-variable-sized-packed-arguments-to-a-taskfunction/ Ou juste passer SIZE à la fonction et avoir un réseau compact suffisamment grand. – Hida