Assigning queues in system verilog

In reply to confused kid:
It’s difficult to teach you SystemVerilog in a forum. I suggest you take some tutorials first, and then go back to your problem.
And you are not being very clear in your questioning. The only difference between the code in you second post is you change int h[8] to int h[k]. Do you mean to be using a subscript hk? You can’t write that in your source code. And now you bring up clock cycles, which you never mentioned in your original question.