1. A method for generating hardware by compiling high-level software code, the method comprising: grouping, by a system, software instructions into groups, wherein grouping the software instructions includes detecting instruction patterns and sequences in the software instructions; transforming, by the system, the groups of software instructions into a hardware description language describing respective hardware blocks, wherein the hardware blocks are hardware representations of the respective groups of software instructions and provide one or more hardware functions for one or more target algorithms described by the groups of software instructions; and generating, by the system, a main module interconnecting and controlling the hardware blocks, wherein the main module includes: i) a register file configured to store data received from the hardware blocks, and ii) a decoder configured to select, for each currently active hardware block, a next hardware block to become active based on pointer information received from the currently active hardware block, and wherein each of the hardware blocks is configured to: receive input data from the register file, transmit result data to the register file, and generate the pointer information for the main module.