Of course it doesn't work. You don't understnd dataflow. The top loop will not start until the bottom finishes and when the bottom finishes, it will immediately stop the top loop. Remove the data dependency between the two loops (i.e. don't wire from one to the other).