title: Way to loop through systemverilog structure members
body: <p>I have a structure x defined as below</p>
  
  <pre><code>typedef struct packed {
    int a;
    int b;
  } x_s;
  </code></pre>
  
  <p>The number of members inside the structure is not deterministic. I want to print out each value of the structure member separately. Is there a way to loop through the structure members?</p>
  
  <p>Thanks in advance.</p>