WO2020255576A1 - 高位合成装置及び高位合成方法 - Google Patents

高位合成装置及び高位合成方法 Download PDF

Info

Publication number
WO2020255576A1
WO2020255576A1 PCT/JP2020/018589 JP2020018589W WO2020255576A1 WO 2020255576 A1 WO2020255576 A1 WO 2020255576A1 JP 2020018589 W JP2020018589 W JP 2020018589W WO 2020255576 A1 WO2020255576 A1 WO 2020255576A1
Authority
WO
WIPO (PCT)
Prior art keywords
code
level synthesis
level
external memory
access
Prior art date
Application number
PCT/JP2020/018589
Other languages
English (en)
French (fr)
Inventor
和治 永島
一樹 池田
Original Assignee
株式会社日立製作所
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 株式会社日立製作所 filed Critical 株式会社日立製作所
Priority to US17/621,010 priority Critical patent/US20220366111A1/en
Publication of WO2020255576A1 publication Critical patent/WO2020255576A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/327Logic synthesis; Behaviour synthesis, e.g. mapping logic, HDL to netlist, high-level language to RTL or netlist
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F30/00Computer-aided design [CAD]
    • G06F30/30Circuit design
    • G06F30/32Circuit design at the digital level
    • G06F30/33Design verification, e.g. functional simulation or model checking

Definitions

  • the present invention relates to a high-level synthesizer that generates a description of a logic circuit using a programming language.
  • HDL hardware description language
  • FPGA Field Programmable Gate Array
  • Patent Document 1 discloses a technique of extracting the loop processing included in the high-level synthesis code and changing the high-level synthesis code so as to shorten the processing time in the loop.
  • an object of the present invention is to automatically generate an optimal hardware description language for hardware in which an external memory is added to an integrated circuit.
  • the present invention is a high-level synthesizer that has a processor and a memory and generates a hardware description code that describes the configuration of an integrated circuit connected to an external memory, and describes a process to be executed by the integrated circuit.
  • a high-level synthesis code adjustment unit that accepts a code and an external memory access variable that exchanges data between the external memory, analyzes the high-level synthesis code, and reconstructs the high-level synthesis code based on the analysis result.
  • the high-level synthesis code adjusting unit has a burst access determination unit that analyzes an external memory access variable in the high-level synthesis code and determines whether or not burst access is possible to the external memory, and the burst access unit. It includes a code reconstructing unit that reconstructs the high-level synthesis code by adding a code that executes burst access to a possible external memory access variable.
  • the present invention automatically generates an optimal hardware description language for hardware in which an external memory is added to an integrated circuit by generating a high-level synthesis code of an integrated circuit that efficiently accesses an external memory. be able to.
  • FIG. 1 is a diagram showing Example 1 of the present invention and showing an example of processing performed on the hardware to be designed. It is a block diagram which shows Example 1 of this invention and shows an example of the hardware which applied the generated hardware description language to an integrated circuit. It is a figure which shows Example 1 of this invention and shows an example of the process which an integrated circuit accesses an external memory.
  • FIG. 5 is a flowchart showing Example 1 of the present invention and showing an example of processing performed by a high-level synthesizer.
  • FIG. 5 is a flowchart showing Example 1 of the present invention and showing an example of burst access determination processing performed by a high-level synthesizer.
  • Example 1 of this invention shows an example of the code reconstruction processing performed in the high-level synthesis apparatus. It is a figure which shows Example 1 of this invention and shows an example of the high-level synthesis code input to the high-level synthesis apparatus. It is a figure which shows Example 1 of this invention and shows an example of the code reconstruction information used by a high-level synthesizer. It is a figure which shows Example 1 of this invention, and shows the example of the access pattern of an external memory incrementing an address. It is a figure which shows Example 1 of this invention, and shows the example of the decrement of an address whose access pattern of an external memory shows.
  • Example 1 of this invention shows the example of the address where the access pattern of an external memory is random. It is a figure which shows Example 1 of this invention and shows an example of the high-level synthesis code reconstructed by a high-level synthesis apparatus. It is a block diagram which shows the conventional example and shows an example of the hardware structure by the conventional example. It is a figure which shows the conventional example and shows an example of the access to the external memory by the conventional example. 2 is a block diagram showing Example 2 of the present invention and showing an example of a high-level synthesizer. 2 is a flowchart showing Example 2 of the present invention and showing an example of processing performed by a high-level synthesizer.
  • Example 2 is a flowchart showing Example 2 of the present invention and showing an example of data width determination processing performed by a high-level synthesizer. It is a figure which shows Example 2 of this invention and shows an example of the code reconstruction information of a high-level synthesizer. It is a figure which shows Example 2 of this invention and shows an example of the code reconstruction processing of a high-level synthesizer. It is a figure which shows Example 2 of this invention and shows an example of the high-level synthesis code generated by the high-level synthesis apparatus. It is a block diagram which shows Example 3 of this invention and shows an example of a high-level synthesizer. FIG. 4 is a block diagram showing Example 4 of the present invention and showing an example of a high-level synthesizer.
  • FIG. 1 is a block diagram showing Example 1 of the present invention and an example of a high-level synthesizer 1.
  • the high-level synthesizer 1 receives the high-level synthesis code and external memory information, and generates a hardware description language (HDL) that describes the configuration of an integrated circuit (logic circuit) to which an external memory is connected.
  • HDL hardware description language
  • the high-level synthesizer 1 is a computer including a processing device (processor) 100, a main storage (memory) 101, a storage device (storage) 200, an input device 300, and a display device 400.
  • the high-level synthesis code storage unit 210, the external memory information storage unit 220, the HDL code storage unit 240, and the code reconstruction database 230 are stored in the storage device 200.
  • the high-level synthesis code storage unit 210 stores the definition (or algorithm) of processing performed in an integrated circuit described in a high-level language such as C language, C ++ language, or Python.
  • the external memory information storage unit 220 stores information of the external memory added to the integrated circuit.
  • the code reconstruction database 230 stores integrated circuit configuration information according to the access pattern to the external memory.
  • the hardware description language generated by the high-level synthesizer 1 is stored in the HDL code storage unit 240. Verilog and VHDL can be adopted as the hardware description language.
  • a high-level synthesis code adjusting unit 10 that adjusts the high-level synthesis code (Tune up) and a high-level synthesis unit 160 that generates an HDL code from the high-level synthesis code reconstructed by the high-level synthesis code adjustment unit 10 are programmed. It is stored as and executed by the processing device 100.
  • the high-level synthesis code adjustment unit 10 is composed of a loop processing extraction unit 110, an external memory access variable determination unit 120, an access pattern analysis unit 130, a burst access determination unit 140, and a code reconstruction unit 150.
  • the processing device 100 mainly includes programs of a loop processing extraction unit 110, an external memory access variable determination unit 120, an access pattern analysis unit 130, a burst access determination unit 140, a code reconstruction unit 150, and a high-level synthesis unit 160. It is read from the memory 101 and made to function respectively.
  • the processing device 100 operates as a functional unit that provides a predetermined function by executing processing according to a program of each functional unit.
  • the processing device 100 functions as the loop processing extraction unit 110 by executing the processing according to the loop processing detection program.
  • the processing device 100 also operates as a functional unit that provides each function of a plurality of processes executed by each program.
  • a computer and a computer system are devices and systems including these functional parts.
  • the loop processing extraction unit 110 reads the high-level synthesis code from the high-level synthesis code storage unit 210 and detects the loop processing in the high-level synthesis code.
  • the external memory access variable determination unit 120 reads the external memory information from the external memory information storage unit 220, and determines a variable for storing the value accessed from the external memory in the loop processing detected by the loop processing extraction unit 110.
  • the access pattern analysis unit 130 analyzes the pattern in which the integrated circuit accesses the external memory by the detected loop processing.
  • the burst access determination unit 140 determines the application of burst access in the loop processing based on the analysis result of the access pattern and the determined variable.
  • the code reconstruction unit 150 added the burst access code to the loop processing of the high-level synthesis code based on the burst access determination result, replaced the variables with buffers, added parallel processing or pipeline processing, and reconstructed. Output high-level synthesis code.
  • the high-level synthesis unit 160 reads the high-level synthesis code whose code has been reconstructed by the code reconstruction unit 150, and outputs a hardware description language code (hereinafter referred to as HDL code) that determines the hardware configuration of the integrated circuit. It is stored in the HDL code storage unit 240.
  • HDL code hardware description language code
  • FIG. 2 is a diagram showing an example of processing performed by hardware.
  • the image 1 and the image 2 are input to the hardware 50 including the integrated circuit, and the integration process of synthesizing the image 1 and the image 2 and the inversion process of outputting the image inverted in the horizontal direction in the figure are executed. Let me.
  • the high-level synthesis code is an input in which the high-level synthesis device 1 generates an HDL code for realizing the above image processing in the integrated circuit of the hardware 50.
  • FIG. 3 is a block diagram showing Example 1 of the present invention and showing an example of hardware 50 in which the hardware description language generated by the high-level synthesizer 1 is applied to an integrated circuit.
  • the hardware 50 shows an example in which the integrated circuit 60 and the external memory 70 are arranged on the board, and the integrated circuit 60 and the external memory 70 are connected by the memory bus 80.
  • the integrated circuit 60 FPGA (Field Programmable Gate Array), ASIC (Application Specific Integrated Circuits), or PLD (Programmable Logic Device) can be adopted.
  • the external memory 70 a DRAM or the like capable of burst transfer can be adopted.
  • the inside of the integrated circuit 60 shows an example of a circuit composed of an HDL code generated from a high-level synthesis code so as to perform the processing shown in FIG. 4 (described later).
  • the integrated circuit 60 temporarily stores the parallel execution control 62 that executes processing in parallel, the burst access control 63 that continuously reads the images 1 and 2 from the external memory 70, and the read images 1 and 2.
  • Buffers FIFO: First In First Out
  • 64, 65, and integration / inversion processing 61 which reads images 1 and 2 from buffers 64 and 65 and executes integration processing and inversion processing to generate an output image.
  • a buffer (BRAM: BlockRAM) 65 for temporarily storing an output image is included. The output image stored in the buffer 65 is written to the external memory 70 at a predetermined timing by the burst access control 63.
  • FIG. 4 is a diagram showing an example of a process in which the integrated circuit 60 accesses the external memory 70.
  • the integrated circuit 60 continuously reads 5 pixels each of images 1 and 2 from the external memory 70 (burst access), inputs them into a buffer composed of a FIFO, and executes integration and inversion processing in parallel.
  • the burst access data is not limited to five, and can be appropriately set according to the specifications of the external memory 70 and the like.
  • the image 1 and the image 2 read by the burst access control 63 are read in parallel into the buffers 64 and 65 configured by the FIFO. Then, the image 1 and the image 2 are acquired by the integration / inversion process 61 in the order of being read into the buffers 64 and 65, and the process is executed to generate an output image.
  • FIG. 5 is a flowchart showing an example of processing performed by the high-level synthesizer 1. This process is started based on a command from the user of the high-level synthesizer 1. Prior to the start of processing, the high-level synthetic code is stored in the high-level synthetic code storage unit 210, and variable information (external memory access variable information 221) for storing data read by the integrated circuit 60 from the external memory 70 is external memory information. It is stored in the storage unit 220 in advance.
  • variable information external memory access variable information 221 for storing data read by the integrated circuit 60 from the external memory 70 is external memory information. It is stored in the storage unit 220 in advance.
  • the processing of the high-level synthesis device 1 includes a process in which the high-level synthesis code adjusting unit 10 receives the high-level synthesis code and the external memory access variable information 221 and reconstructs the high-level synthesis code based on the analysis result of the high-level synthesis code. A process of inputting the reconstructed high-level synthesis code into the high-level synthesis unit 160 to generate an HDL code is performed.
  • the loop processing extraction unit 110 reads the high-level synthesis code from the high-level synthesis code storage unit 210, extracts the loop processing included in the high-level synthesis code, and extracts the loop extraction result 231 as the code reconstruction information of the code reconstruction database 230. It is stored in 235 (S100).
  • the external memory access variable determination unit 120 reads the external memory access variable information 221 from the external memory information storage unit 220, determines the variable to be used in the loop processing of the high-level synthesis code, and determines the external memory access variable determination result 232. Is written in the code reconstruction information 235 of the code reconstruction database 230 (S200).
  • the external memory access variable information 221 is an array variable (FIGS. 10A to 10C) for reading data from the external memory 70, and is preset information. Further, the external memory information storage unit 220 is preset based on the design information of the external memory 70 mounted on the hardware 50 (on the board) and the integrated circuit 60 for accessing the external memory 70.
  • the access pattern analysis unit 130 analyzes the access pattern when reading data from the external memory 70 in the loop processing of the high-level synthesis code, and writes the analysis result as the access pattern result 233 in the code reconstruction information 235 of the code reconstruction database 230. (S300).
  • the access pattern result 233 can, for example, classify the address of the external memory 70 into increment, decrement, random, or the like.
  • the burst access determination unit 140 determines whether or not burst access is possible based on the access pattern result 233, and writes the burst access determination result 234 to the code reconstruction information 235 of the code reconstruction database 230 (S400). ..
  • the code reconstruction unit 150 reads the code reconstruction information 235 from the code reconstruction database 230, and if the burst access determination result 234 is burst accessible, the code of the burst access is set to a higher level based on the access method and the access pattern. It is added to the loop processing of the synthetic code (S500). Further, the code reconstruction unit 150 changes the variable in the high-level synthesis code 211 into a buffer. Further, the code reconstruction unit 150 changes to parallel processing or pipeline processing according to the type of buffer that uses the processing in the high-level synthesis code 211.
  • the code reconstruction unit 150 reconfigures (changes) the code such as adding burst access processing, changing to the buffer, parallelizing or pipelined.
  • the code reconstruction unit 150 generates a high-level synthesis code in which the code is reconstructed by burst access or the like, and outputs the high-level synthesis code to the high-level synthesis unit 160.
  • the high-level synthesis unit 160 analyzes the high-level synthesis code output from the code reconstruction unit 150, outputs the HDL code, and stores it in the HDL code storage unit 240 (S600).
  • the loop processing of the high-level synthesis code is extracted, the burst access is added, and the code of the parallel processing is automatically reconstructed, and the high-level synthesis unit 160 is HDL from the high-level synthesis code in which the code is reconstructed.
  • the code 241 is generated and stored in the HDL code storage unit 240.
  • the high-level synthesis code and the external memory access variable information 221 are stored in advance in the storage device 200, but the high-level synthesis code and the external memory access variable information 221 are stored in the external device 200 at the start of processing. It may be accepted from the input device 300.
  • FIG. 8 is a diagram showing an example of the high-level synthesis code 211 input to the high-level synthesis device 1.
  • the high-level synthesis code 211 is a source code that describes the processing to be executed by the integrated circuit 60, and is stored in advance in the high-level synthesis code storage unit 210.
  • the integrated circuit 60 reads two images (img1 and img2 in the figure) from the external memory 70, adds pixels having the same coordinates, and inverts them to generate an output image. Is shown.
  • the high-level synthesis code 211 includes two loop processes 500 and 501.
  • the label “LOOP1” is set in the loop process 500, and the label “LOOP11” is set in the loop process 501.
  • FIG. 9 is a diagram showing an example of code reconstruction information 235 used by the high-level synthesizer 1.
  • the code reconstruction information 235 includes a loop # 2351 that stores the loop processing identifier extracted from the high-level synthesis code 211, a loop name 2352 that stores the loop processing name, and a variable # that stores the identifier of the variable that stores the data. 2353, an external memory access variable 2354 that stores the name of the variable that stores data, an access method / access pattern 2355 that stores the access method and access pattern to the external memory 70, and burst access that stores the availability of burst access.
  • One entry includes 2356, a buffer 2357 for storing the buffer format, a buffer name 2358 for storing the buffer name, and a buffer size 2359 for storing the buffer capacity.
  • Loop # 2351 is an identifier given by the loop processing extraction unit 110, and is set for each loop extracted from the high-level synthesis code 211.
  • the loop name 2352 stores the name (label) of the loop acquired from the high-level synthesis code 211 by the loop processing extraction unit 110.
  • Variable # 2353 stores an identifier set by the external memory access variable determination unit 120.
  • the external memory access variable 2354 stores the name of the variable acquired by the external memory access variable determination unit 120 from the high-level synthesis code 211.
  • the access method / access pattern 2355 stores the access method and access pattern to the external memory 70 during the loop processing analyzed by the access pattern analysis unit 130.
  • the burst access 2356 stores the possibility of burst access determined by the burst access determination unit 140. If burst access is possible, "OK" is stored, and if burst access is not possible, "NG" is stored.
  • the buffer 2357 stores the format of the buffer assigned to the external memory access variable 2354 determined by the burst access determination unit 140.
  • As the buffer format FIFO, double buffer, or the like can be set.
  • the buffer name 2358 stores the name of the buffer determined by the burst access determination unit 140 based on the high-level synthesis code 211.
  • the buffer size 2359 stores a capacity determined by the burst access determination unit 140 based on the high-level synthesis code 211.
  • FIG. 10A is a diagram showing an example in which the access pattern of the external memory 70 is incremented.
  • the illustrated example shows a pattern in which the address (or index) i is incremented (added) to the data array 131 of the variable X to sequentially access adjacent addresses.
  • the access direction 134 is the direction in which the address increases.
  • FIG. 10B is a diagram showing an example in which the access pattern of the external memory 70 is decremented.
  • the illustrated example shows a pattern in which the address (or index) i is decremented (subtracted) from the data array 132 of the variable Y to sequentially access adjacent addresses.
  • the access direction 134 is the direction in which the address decreases.
  • FIG. 10C is a diagram showing an example of an address in which the access pattern of the external memory 70 is random.
  • the illustrated example shows an example in which the data array 133 of the variable Z is accessed in the direction 134 in which the address (or index) i randomly increases or decreases.
  • the access pattern analysis unit 130 determines which of the above FIGS. 10A to 10C is the access pattern of the external memory 70 in the loop processing, and writes the determination result in the access method / access pattern 2355 of the code reconstruction information 235. ..
  • the loop process for sequentially accessing the data of adjacent addresses is changed to burst access, and a plurality of data of adjacent addresses are collectively accessed.
  • the burst access of this embodiment shows an example of reading five data having consecutive addresses with one burst read instruction.
  • burst access is performed in the direction of incrementing the address of FIG. 10A.
  • the image inversion process as shown in FIG. 10B, the address is accessed in the direction of decrementing.
  • the access pattern analysis unit 130 can analyze the access pattern by parsing the high-level synthesis code 211 or by compiling the code and then analyzing the address.
  • FIG. 6 is a flowchart showing an example of burst access determination processing performed by the high-level synthesizer 1. This process is the process of the burst access determination unit 140 shown in step S400 of FIG.
  • the burst access determination unit 140 selects one external memory access variable 2354 from the code reconstruction information 235 and reads the entry (S401). The burst access determination unit 140 determines whether or not the access pattern of the access method / access pattern 2355 is an increment (S402). If it is an increment, the process proceeds to step S404, and if not, the process proceeds to step S403.
  • step S404 the burst access determination unit 140 determines that the variable is a variable capable of burst access, and stores "OK" in the burst access 2356 of the code reconstruction information 235.
  • step S405 the burst access determination unit 140 determines the buffer format to FIFO and writes it to the buffer 2357 of the code reconstruction information 235.
  • step S403 the burst access determination unit 140 determines whether or not the access pattern is decrement. If it is a decrement, the process proceeds to step S405, and if not, the process proceeds to step S409.
  • step S405 the burst access determination unit 140 determines that the variable is a variable capable of burst access, and stores "OK" in the burst access 2356 of the code reconstruction information 235.
  • step S407 the burst access determination unit 140 determines the buffer format as the double buffer and writes it in the buffer 2357 of the code reconstruction information 235.
  • step S408 the burst access determination unit 140 registers the number of loop processes as the buffer size 2359 in the code reconstruction information 235.
  • step S409 the burst access determination unit 140 determines whether or not the processing has been completed for all the variables of the code reconstruction information 235, and if not, returns to step S401 and repeats the above processing to complete the processing. If so, the process ends.
  • the integrated circuit 60 uses the accessed data in sequential calculation. Therefore, by setting the FIFO (first in, first out), it is possible to perform calculation in "parallel" while performing burst access.
  • the burst access determination unit 140 sets the double buffer configuration.
  • the double buffer two buffers, a data access buffer and an arithmetic buffer, are set, and by switching alternately, burst access and arithmetic can be processed at the same time. That is, in this embodiment, the speed of processing is realized by pipelined the burst access and the arithmetic processing.
  • FIG. 7 is a flowchart showing an example of the code reconstruction process performed by the high-level synthesizer. This process is the process of the code reconstructing unit 150 shown in step S500 of FIG.
  • step S501 the code reconstruction unit 150 determines whether or not the code reconstruction process has not been executed and there is a loop process including the external memory access variable 2354, and if there is an unexecuted loop process, the step The process proceeds to S502, and if not, the process ends.
  • step S502 the code reconstruction unit 150 selects one unexecuted loop process (loop name 2352) from the code reconstruction information 235.
  • step S503 the code reconstruction unit 150 reads the burst access 2356 of the code reconstruction information 235 and determines whether or not burst access is possible. If the burst access 2356 is "OK", the process proceeds to step S504, otherwise the process proceeds to step S505.
  • step S505 the code reconstructing unit 150 speeds up the loop processing, then returns to step S501 and repeats the above processing.
  • speeding up the loop processing processing such as pipelined or parallelized operations in the loop processing may be performed.
  • step S504 the code reconstruction unit 150 selects one external memory access variable 2354 from the selected loop processing.
  • step S506 the code reconstruction unit 150 determines whether the selected variable is a read or a write. If it is a read, the process proceeds to step S507, and if it is a write, the process proceeds to step S508.
  • step S507 the code reconstruction unit 150 adds the burst read code to the high-level synthesis code 211 outside the currently selected loop processing.
  • step S508 the code reconstruction unit 150 adds the burst write code to the high-level synthesis code 211 outside the currently selected loop processing.
  • step S509 the code reconstruction unit 150 reads the buffer name 2538 from the code reconstruction information 235 and adds it to the high-level synthesis code 211 as a buffer variable used in burst access.
  • step S510 the code reconstruction unit 150 replaces the external memory access variable 2354 of the high-level synthesis code 211 with the buffer variable (2358). Then, in step S511, the code reconstruction unit 150 refers to the buffer 2357 of the code reconstruction information 235 and determines whether or not the buffer of the currently selected variable is the FIFO. The code reconstruction unit 150 proceeds to step S512 if the buffer is FIFO, and proceeds to step S513 if the buffer is not FIFO.
  • step S512 the code reconstruction unit 150 adds parallel processing of the loop by burst access to the high-level synthesis code 211.
  • step S513 the code reconstruction unit 150 adds a loop pipeline process by burst access to the high-level synthesis code 211.
  • the code reconstruction unit 150 returns to step S503 and performs processing on other variables of the same loop processing (2352).
  • the code reconstructing unit 150 executes the above processing for all the loop processing to be processed.
  • FIG. 11 is a diagram showing an example of the high-level synthesis code 212 reconstructed by the high-level synthesis device 1.
  • the code group of reference numeral 510 in the figure indicates the buffer added in step S509 of FIG.
  • the code "#pragama” of reference numeral 511 in the figure is a control code for parallel processing or pipeline processing in steps S512 or S513.
  • "#Pragama” is a preprocessor directive, and pipeline and parallelization of loop processing are performed based on the directive. The notation differs depending on the type of the high-level synthesis unit 160.
  • the code group of reference numeral 512 in the figure indicates the control code of the burst read added in step S507 of FIG.
  • the code group of reference numeral 513 in the figure shows an example in which the variables according to steps S505 and S510 in FIG. 7 are replaced with buffers to speed up the processing.
  • the code group of reference numeral 513 in the figure indicates the control code of the burst light added in step S508 of FIG.
  • FIG. 12 is a block diagram showing a conventional example and showing an example of the hardware configuration according to the conventional example. An example is shown in which an HDL code that accesses an external memory 70 from an integrated circuit 60 to perform integration and inversion processing is generated according to the conventional example and applied to the hardware 50.
  • FIG. 13 shows a conventional example and is a diagram showing an example of hardware processing according to the conventional example.
  • the calculation process is performed by reading the image 1 pixel at a time.
  • the present embodiment by generating the high-level synthesis code 212 that efficiently accesses the external memory 70, the optimum hardware for the hardware 50 in which the external memory 70 is added to the integrated circuit 60. It is possible to automatically generate a description language.
  • FIG. 14 is a block diagram showing Example 2 of the present invention and showing an example of a high-level synthesizer.
  • the high-level synthesis code adjusting unit 10 is provided with a data width determination unit 170 in place of the burst access determination unit 140 of the first embodiment, and the code reconstruction information 235 is the code reconstruction information 235 of the first embodiment as shown in FIG.
  • the burst access 2356 of the above is replaced with the parallel accessible number 2360, and the buffer 2357, the buffer name 2358, and the buffer size 2359 are replaced with the temporary register name 2361.
  • Other configurations are the same as those of the first embodiment.
  • the data width determination unit 170 compares the data type of the external memory access variable with the number of data that can be accessed in parallel so that the data width of the memory bus 80 connecting the external memory 70 and the integrated circuit 60 can be effectively used. To determine.
  • the integrated circuit 60 accesses the two pixels in parallel to increase the processing speed as compared with the conventional example. Is possible.
  • the access pattern analysis unit 130 analyzes the access pattern in the same manner as in the first embodiment.
  • FIG. 15 is a flowchart showing an example of processing performed by the high-level synthesizer 1. Steps S100 to S300 are the same as in FIG. 5 of the first embodiment.
  • the data width determination unit 170 determines whether or not a plurality of pixels can be accessed in parallel based on the access pattern result in step S300, calculates the number of parallel accessible numbers if possible, and determines the data width determination result. 236 is written to the parallel accessible number 2360 of the code reconstruction information 235 of the code reconstruction database 230 (S400).
  • the code reconstruction unit 150 reads the code reconstruction information 235 from the code reconstruction database 230, and if the number of parallel accesses 2360 is 2 or more, parallel access is possible. Therefore, based on the access method and the access pattern, the code reconstruction unit 150 can perform parallel access.
  • the parallel access code is added to the loop processing of the high-level synthesis code (S700). Further, the code reconstruction unit 150 changes the variable in the high-level synthesis code 211 to a temporary register.
  • the code reconstruction unit 150 reconstructs (changes) the code such as adding parallel access and changing to the temporary register (S800).
  • the code reconstruction unit 150 generates a high-level synthesis code in which the code is reconstructed by parallel access or the like, and outputs it to the high-level synthesis unit 160.
  • the high-level synthesis unit 160 analyzes the high-level synthesis code output from the code reconstruction unit 150, outputs the HDL code, and stores it in the HDL code storage unit 240 (S600).
  • FIG. 16 is a flowchart showing an example of data width determination processing performed by the high-level synthesizer 1. This process is the process of the data width determination unit 170 shown in step S700 of FIG.
  • the data width determination unit 170 selects one external memory access variable 2354 from the code reconstruction information 235 and reads the entry (S701). The data width determination unit 170 determines whether or not the access pattern of the access method / access pattern 2355 is increment or decrement (S702). If it is increment or decrement, the process proceeds to step S703, otherwise the process proceeds to step S705.
  • step S703 the data width determination unit 170 determines that the variable is a variable that can be accessed in parallel, and calculates the number of parallel accessable numbers based on the number of bits of one data to be read and the data width of the memory bus 80.
  • the data width determination unit 170 stores the number of pixels that can simultaneously access the parallel accessible number 2360 of the code reconstruction information 235. In this embodiment, the number of pixels is used, but in the case of other than image data, the number of data may be stored.
  • step S704 the data width determination unit 170 registers the register for executing parallel access in the temporary register name 2361 of the code reconstruction information 235.
  • the temporary register name 2361 can be set according to the external memory access variable 2354 for input / output.
  • step S705 the data width determination unit 170 determines whether or not the processing has been completed for all the variables of the code reconstruction information 235, and if not, returns to step S701 and repeats the above processing to complete the process. If so, the process ends.
  • FIG. 17 is a diagram showing an example of code reconstruction information of the high-level synthesizer.
  • the burst access 2356 of the first embodiment is replaced with the parallel accessible number 2360, and the buffer 2357, the buffer name 2358, and the buffer size 2359 are replaced with the temporary register name 2361.
  • the data type of the variable is 8 bits
  • the data width of the memory bus 80 is 16 bits
  • the number of data that can be accessed at the same time is "2".
  • FIG. 18 is a diagram showing an example of the code reconstruction process of the high-level synthesizer 1. This process is the process of the code reconstructing unit 150 shown in step S800 of FIG.
  • step S801 the code reconstruction unit 150 determines whether or not the code reconstruction process has not been executed and there is a loop process including the external memory access variable 2354. If there is an unexecuted loop process, the step Proceed to S802, and if not, the process ends.
  • step S802 the code reconstruction unit 150 selects one unexecuted loop process (loop name 2352) from the code reconstruction information 235.
  • step S803 the code reconstruction unit 150 reads the parallel accessable number 2360 of the code reconstruction information 235 and determines whether or not parallel access is possible. If the number of parallel accessible numbers 2360 is 2 or more, the process proceeds to step S804, otherwise the process returns to step S801 and the above processing is performed for the next loop.
  • step S804 the code reconstruction unit 150 selects one external memory access variable 2354 from the selected loop processing.
  • step S805 the code reconstruction unit 150 changes the data type (number of bits) of the selected variable according to the number of parallel accessible numbers 2360.
  • step S806 the code reconstruction unit 150 adds the temporary register variable corresponding to the currently selected variable to the high-level synthesis code 211.
  • step S807 the code reconstruction unit 150 replaces the external memory access variable whose data type has been changed with the temporary register.
  • step S808 the code reconstruction unit 150 refers to the access method / access pattern 2355 of the code reconstruction information 235 and determines whether or not the access of the external memory access variable is the read.
  • the code reconstructing unit 150 proceeds to step S809 if the access is read, and proceeds to step S810 if the access is write.
  • step S809 the code reconstruction unit 150 adds the assignment process from the external memory access variable 2354 to the temporary register to the high-level synthesis code 211.
  • the code reconstruction unit 150 adds a predetermined bit operation such as shifting for each pixel in order to access a plurality of pixels at the same time.
  • step S810 the code reconstruction unit 150 adds the assignment process from the temporary register to the external memory access variable 2354 to the high-level synthesis code 211.
  • the code reconstruction unit 150 adds a predetermined bit operation such as shifting for each pixel in order to access a plurality of pixels at the same time.
  • step S811 the code reconstructing unit 150 determines whether or not there is an unprocessed variable that can be accessed in parallel in the current loop processing, and if there is an unprocessed variable, returns to step S804 and described above. The process is repeated, and if there are no unprocessed variables, the process proceeds to step S812.
  • step S812 the code reconstruction unit 150 changes the number of loop processes of the high-level synthesis code 211 to the number of loop processes / the number of parallel accesses. Then, the process returns to step S801 and the above process is repeated to execute the above process for all the loop processes to be processed.
  • FIG. 19 is a diagram showing an example of the high-level synthesis code 213 reconstructed by the high-level synthesis device 1.
  • the high-level synthesis code 213 of this embodiment is reconstructed into a process of reading the data accessed by the integrated circuit 60 into a temporary register prepared according to the number of parallels and performing operations in parallel.
  • the code of reference numeral 520 in the figure indicates the data type (number of bits) changed in step S805 of FIG.
  • the code group of reference numeral 521 in the figure indicates a temporary register added by step S806 of FIG.
  • the code of reference numeral 522 in the figure indicates the number of loops changed in step S812 of FIG.
  • the code group of reference numeral 523 in the figure shows the assignment process from the external memory access variable to the temporary register in step S809 of FIG.
  • the code group of reference numeral 524 in the figure shows the description of the replacement of the external memory access variable with the temporary register and the parallelization of the operation in step S807 of FIG.
  • the code group of reference numeral 525 in the figure shows the assignment process from the temporary register to the external memory access variable in step S810 of FIG.
  • the high-level synthesis code adjusting unit 10 shortens the processing time by increasing the number of parallel operations according to the data width of the memory bus 80 of the external memory 70, and the processing performance of the hardware 50. Can be improved.
  • FIG. 20 is a block diagram showing Example 3 of the present invention and an example of the high-level synthesizer 1.
  • the maximum buffer size is specified as the constraint condition of the integrated circuit 60
  • the number of loops is divided so that the high-level synthesis code after reconstruction satisfies the constraint condition.
  • the high-level synthesizer 1 of this embodiment is obtained by adding a constraint condition storage unit 250, a constraint condition determination unit 180, and a code modification proposal determination unit 190 to the configuration of the first embodiment, and the other configurations are the above-mentioned embodiment. It is the same as Example 1.
  • the constraint condition determination unit 180 and the code modification proposal determination unit 190 are added to the high-level synthesis code adjustment unit 10.
  • the constraint condition storage unit 250 stores the maximum value of the buffer size that can be set by the integrated circuit 60.
  • the constraint condition determination unit 180 reads the high-level synthesis code 212 output by the code reconstruction unit 150 and determines whether or not the described buffer size satisfies the condition of the constraint condition storage unit 250.
  • the constraint condition determination unit 180 When the buffer size of the high-level synthesis code 212 exceeds the maximum value of the constraint condition storage unit 250, the constraint condition determination unit 180 notifies the code modification proposal determination unit 190.
  • the code modification proposal determination unit 190 identifies the loop processing in which the buffer size exceeds the maximum value of the constraint condition storage unit 250, and proposes division of the loop processing and the like. The content of the proposal may be output to the display device 400.
  • FIG. 21 is a block diagram showing Example 4 of the present invention and showing an example of a high-level synthesizer. In this embodiment, the burst access control of the first embodiment and the parallel access of the second embodiment are combined.
  • the burst access determination unit 140 is arranged after the data width determination unit 170.
  • Other configurations are the same as those in Examples 1 and 2.
  • the processing performance of the integrated circuit 60 can be further improved by the parallel access by the temporary register in addition to the burst access.
  • the high-level synthesizer of Examples 1 to 4 can have the following configuration.
  • a high-level synthesizer (1) having a processor (processing device 100) and a memory (main memory 101) and generating a hardware description code describing the configuration of an integrated circuit (60) connected to an external memory (70). 1), the high-level synthesis code (211) describing the processing to be executed by the integrated circuit (60), and the external memory access variable (221) for exchanging data between the external memory (70).
  • a burst access determination unit (140) that analyzes the external memory access variable (221) in the high-level composite code (211) and determines whether or not burst access is possible to the external memory (70).
  • a code reconstructing unit (150) for reconstructing the external memory access variable (221) capable of burst access by adding a code for executing burst access to the high-level composite code (211) is included.
  • the high-level synthesis device adds a code for executing burst access to the high-level synthesis code 211 to re-execute the high-level synthesis code 212.
  • a code for executing burst access to the high-level synthesis code 211 to re-execute the high-level synthesis code 212.
  • the high-level synthesis code (212) reconstructed by the code reconstructing unit (150) is input to input the hardware description code. It further has a high-level synthesis unit (160) to be generated.
  • the high-level synthesis unit 160 can generate the HDL code of the integrated circuit 60 by inputting the high-level synthesis code 212 to which the burst access code is added.
  • the integrated circuit 60 can speed up the processing by collectively accessing the data by burst access.
  • the high-level synthesis code adjusting unit (10) is a loop processing extraction unit (1) that extracts the loop processing in the high-level synthesis code (211). 110), and an external memory access variable determination unit (120) for determining the external memory access variable (221) described in the loop processing are further included.
  • the high-level synthesis code 212 can be reconstructed by adding the burst access code. it can.
  • the high-level synthesis code adjusting unit (10) accesses the external memory (70) in the external memory access variable (221). It further includes an access pattern analysis unit (130) that analyzes the pattern.
  • the external memory access variable described in the loop processing of the high-level synthesis code 211 can be targeted for burst access, and the burst access pattern can be determined.
  • the burst access determination unit (140) determines a preset buffer according to the access pattern, and the code reconstruction unit. (150) adds the code for pipeline processing or parallel processing according to the determined type of the buffer.
  • the code reconfiguration unit 150 reconfigures (changes) the code such as adding burst access processing, changing to a buffer, parallelizing, or pipelined.
  • the code reconstruction unit 150 can generate a high-level synthesis code 212 whose code is reconstructed by burst access or the like and output it to the high-level synthesis unit 160.
  • the integrated circuit 60 can efficiently access the external memory 70 and execute arithmetic processing at high speed.
  • the present invention is not limited to the above-mentioned examples, and includes various modifications.
  • the above-described embodiment is described in detail in order to explain the present invention in an easy-to-understand manner, and is not necessarily limited to the one having all the configurations described.
  • any of addition, deletion, or replacement of other configurations can be applied alone or in combination.
  • each of the above configurations, functions, processing units, processing means, etc. may be realized by hardware by designing a part or all of them, for example, by an integrated circuit. Further, each of the above configurations, functions, and the like may be realized by software by the processor interpreting and executing a program that realizes each function. Information such as programs, tables, and files that realize each function can be placed in a memory, a hard disk, a recording device such as an SSD (Solid State Drive), or a recording medium such as an IC card, an SD card, or a DVD.
  • SSD Solid State Drive
  • control lines and information lines indicate what is considered necessary for explanation, and not all control lines and information lines are necessarily shown on the product. In practice, it can be considered that almost all configurations are interconnected.
  • a high-level synthesis device having a processor and a memory is a high-level synthesis method that generates a hardware description code that describes the configuration of an integrated circuit connected to an external memory.
  • a code reconstruction step in which the high-level synthesizer reconstructs the high-level synthesis code by adding a code that executes a predetermined process in parallel to the external memory access variable that can be accessed in parallel.
  • a high-level synthesis method characterized by containing.
  • a high-level synthesis method wherein the high-level synthesis apparatus further includes a high-level synthesis step of inputting the reconstructed high-level synthesis code to generate the hardware description code.
  • a computer equipped with a processor, memory, and storage device which is a storage medium that stores a program for generating a hardware description code that describes the configuration of an integrated circuit connected to an external memory.
  • An input step that accepts a high-level synthesis code that describes a process to be executed by the integrated circuit and an external memory access variable that exchanges data between the external memory and the external memory.
  • a burst access determination step that analyzes an external memory access variable in the high-level synthesis code and determines whether or not burst access is possible to the external memory.
  • a non-temporary computer-readable storage medium that stores a program for causing the computer to execute.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Geometry (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Memory System Of A Hierarchy Structure (AREA)
  • Image Processing (AREA)

Abstract

プロセッサとメモリを有し、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成装置は、前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数を受け付けて、前記高位合成コードを解析し、解析結果に基づいて前記高位合成コードを再構成する高位合成コード調整部を有し、前記高位合成コード調整部は、前記高位合成コード内の外部メモリアクセス変数を解析し、前記外部メモリにバーストアクセスが可能かを判定するバーストアクセス判定部と、前記バーストアクセスが可能な外部メモリアクセス変数に対して、バーストアクセスを実行するコードを前記高位合成コードに付加するコード再構成部と、を含む。

Description

高位合成装置及び高位合成方法 参照による取り込み
 本出願は、令和1年(2019年)6月21日に出願された日本出願である特願2019-115205の優先権を主張し、その内容を参照することにより、本出願に取り込む。
 本発明は、プログラミング言語を用いて論理回路の記述を生成する高位合成装置に関する。
 FPGA(Field Programmable Gate Array)等の集積回路(又は論理回路)の構成を記述する言語としてハードウェア記述言語(HDL:hardware description language)が知られている。
 ハードウェア記述言語を用いた集積回路の設計では、ソースコードの量が膨大になる場合があり、近年では、C言語などの高級言語を用いてアルゴリズム等の設計を行ってソースコード(高位合成コード)の量を低減し、ハードウェア記述言語を生成する技術が知られている(例えば、特許文献1)。
 特許文献1では、高位合成コードに含まれるループ処理を抽出し、ループ内の処理時間を短縮するように高位合成コードを変更する技術が開示されている。
国際公開2017/154183号
 近年では、FPGA等の集積回路で画像処理や機械学習等の大量のデータを処理することが検討されている。画像等の大量のデータを扱う場合では、FPGAの外部にメモリを付加して、入力されたデータを一旦外部メモリに格納してから集積回路で処理する構成が望ましい。
 しかしながら、上記従来例では、集積回路に外部メモリを付加した構成を考慮しておらず、外部メモリを利用する最適なハードウェア記述言語を自動的に生成できない、という問題があった。
 そこで本発明は、上記問題点に鑑みてなされたもので、集積回路に外部メモリを付加したハードウェアに最適なハードウェア記述言語を自動的に生成することを目的とする。
 本発明は、プロセッサとメモリを有し、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成装置であって、前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付けて、前記高位合成コードを解析し、解析結果に基づいて前記高位合成コードを再構成する高位合成コード調整部を有し、前記高位合成コード調整部は、前記高位合成コード内の外部メモリアクセス変数を解析し、前記外部メモリにバーストアクセスが可能か否かを判定するバーストアクセス判定部と、前記バーストアクセスが可能な外部メモリアクセス変数に対して、バーストアクセスを実行するコードを前記高位合成コードに付加して再構成するコード再構成部と、を含む。
 したがって、本発明は、外部メモリへのアクセスを効率よく行う集積回路の高位合成コードを生成することで、集積回路に外部メモリを付加したハードウェアに最適なハードウェア記述言語を自動的に生成することができる。
 本明細書において開示される主題の、少なくとも一つの実施の詳細は、添付されている図面と以下の記述の中で述べられる。開示される主題のその他の特徴、態様、効果は、以下の開示、図面、請求項により明らかにされる。
本発明の実施例1を示し、高位合成装置の一例を示すブロック図である。 本発明の実施例1を示し、設計対象のハードウェアで行われる処理の一例を示す図である。 本発明の実施例1を示し、生成されたハードウェア記述言語を集積回路に適用したハードウェアの一例を示すブロック図である。 本発明の実施例1を示し、集積回路が外部メモリにアクセスする処理の一例を示す図である。 本発明の実施例1を示し、高位合成装置で行われる処理の一例を示すフローチャートである。 本発明の実施例1を示し、高位合成装置で行われるバーストアクセス判定処理の一例を示すフローチャートである。 本発明の実施例1を示し、高位合成装置で行われるコード再構成処理の一例を示すフローチャートである。 本発明の実施例1を示し、高位合成装置に入力される高位合成コードの一例を示す図である。 本発明の実施例1を示し、高位合成装置が使用するコード再構成情報の一例を示す図である。 本発明の実施例1を示し、外部メモリのアクセスパターンがアドレスのインクリメントの例を示す図である 本発明の実施例1を示し、外部メモリのアクセスパターンがアドレスのデクリメントの例を示す図である 本発明の実施例1を示し、外部メモリのアクセスパターンがランダムなアドレスの例を示す図である 本発明の実施例1を示し、高位合成装置が再構成した高位合成コードの一例を示す図である。 従来例を示し、従来例によるハードウェアの構成の一例を示すブロック図である。 従来例を示し、従来例による外部メモリへのアクセスの一例を示す図である。 本発明の実施例2を示し、高位合成装置の一例を示すブロック図である。 本発明の実施例2を示し、高位合成装置で行われる処理の一例を示すフローチャートである。 本発明の実施例2を示し、高位合成装置で行われるデータ幅判定処理の一例を示すフローチャートである。 本発明の実施例2を示し、高位合成装置のコード再構成情報の一例を示す図である。 本発明の実施例2を示し、高位合成装置のコード再構成処理の一例を示す図である。 本発明の実施例2を示し、高位合成装置が生成する高位合成コードの一例を示す図である。 本発明の実施例3を示し、高位合成装置の一例を示すブロック図である。 本発明の実施例4を示し、高位合成装置の一例を示すブロック図である。
 以下、本発明の実施形態を添付図面に基づいて説明する。
 図1は、本発明の実施例1を示し、高位合成装置1の一例を示すブロック図である。高位合成装置1は、高位合成コードと外部メモリ情報を受け付けて、外部メモリを接続した集積回路(論理回路)の構成を記述したハードウェア記述言語(HDL:hardware description language)を生成する。
 高位合成装置1は、処理装置(プロセッサ)100と、主記憶(メモリ)101と、記憶装置(ストレージ)200と、入力装置300と、表示装置400を含む計算機である。
 記憶装置200には、高位合成コード記憶部210と、外部メモリ情報記憶部220と、HDLコード記憶部240と、コード再構成データベース230が格納されている。
 高位合成コード記憶部210には、C言語やC++言語やPython等の高級言語で記述された集積回路で行われる処理の定義(またはアルゴリズム)が格納される。外部メモリ情報記憶部220は、集積回路に付加された外部メモリの情報が格納される。
 コード再構成データベース230には、外部メモリへのアクセスパターンに応じた集積回路の構成情報が格納される。HDLコード記憶部240には、高位合成装置1が生成したハードウェア記述言語が格納される。ハードウェア記述言語としては、VerilogやVHDLを採用することができる。
 主記憶101には、高位合成コードを調整(Tune up)する高位合成コード調整部10と、高位合成コード調整部10で再構成された高位合成コードからHDLコードを生成する高位合成部160がプログラムとして格納されて処理装置100によって実行される。
 高位合成コード調整部10は、ループ処理抽出部110と、外部メモリアクセス変数決定部120と、アクセスパターン解析部130と、バーストアクセス判定部140と、コード再構成部150から構成される。
 処理装置100は、ループ処理抽出部110と、外部メモリアクセス変数決定部120と、アクセスパターン解析部130と、バーストアクセス判定部140と、コード再構成部150と、高位合成部160のプログラムを主記憶101から読み込んでそれぞれ機能させる。
 処理装置100は、各機能部のプログラムに従って処理を実行することによって、所定の機能を提供する機能部として稼働する。例えば、処理装置100は、ループ処理検出プログラムに従って処理を実行することでループ処理抽出部110として機能する。他のプログラムについても同様である。さらに、処理装置100は、各プログラムが実行する複数の処理のそれぞれの機能を提供する機能部としても稼働する。計算機及び計算機システムは、これらの機能部を含む装置及びシステムである。
 ループ処理抽出部110は、高位合成コード記憶部210から高位合成コードを読み込んで、高位合成コード内のループ処理を検出する。外部メモリアクセス変数決定部120は、外部メモリ情報記憶部220から外部メモリ情報を読み込んで、ループ処理抽出部110で検出されたループ処理で外部メモリからアクセスした値を格納する変数を決定する。
 アクセスパターン解析部130は、検出されたループ処理で、集積回路が外部メモリをアクセスするパターンを解析する。バーストアクセス判定部140は、アクセスパターンの解析結果と決定された変数に基づいて、ループ処理におけるバーストアクセスの適用を判定する。
 コード再構成部150は、バーストアクセスの判定結果に基づいて高位合成コードのループ処理にバーストアクセスのコードを追加し、変数をバッファに置き換え、処理の並列化またはパイプライン処理を加え、再構成した高位合成コードを出力する。
 高位合成部160は、コード再構成部150でコードを再構成された高位合成コードを読み込んで、集積回路のハードウェアの構成を決定するハードウェア記述言語のコード(以下HDLコード)を出力してHDLコード記憶部240に格納する。
 図2は、ハードウェアで行われる処理の一例を示す図である。本実施例では、集積回路を含むハードウェア50に画像1と画像2を入力し、画像1と画像2を合成する積算処理と、図中水平方向で反転させた画像を出力させる反転処理を実行させる。
 高位合成コードは、上記画像処理をハードウェア50の集積回路で実現させるためのHDLコードを高位合成装置1で生成させる入力である。
 図3は、本発明の実施例1を示し、高位合成装置1で生成したハードウェア記述言語を集積回路に適用したハードウェア50の一例を示すブロック図である。
 ハードウェア50は、基板上に集積回路60と外部メモリ70を配置し、メモリバス80で集積回路60と外部メモリ70を接続する例を示す。集積回路60としては、FPGA(Field Programmable Gate Array)や、ASIC(Application Specific Integrated Circuits)あるいはPLD(Programmable Logic Device)を採用することができる。外部メモリ70としては、バースト転送が可能なDRAM等を採用することができる。
 集積回路60の内部は、図4(後述)に示す処理を行うように、高位合成コードから生成されたHDLコードによって構成された回路の一例を示す。
 集積回路60は、処理を並列的に実行する並列実行制御62と、外部メモリ70から画像1と画像2を連続的に読み込むバーストアクセス制御63と、読み込んだ画像1と画像2を一時的に格納するバッファ(FIFO:First In First Out)64、65と、バッファ64、65から画像1と画像2を読み込んで、積算処理と反転処理を実行して出力画像を生成する積算・反転処理61と、出力画像を一時的に格納するバッファ(BRAM:Block RAM)65を含む。なお、バッファ65に格納された出力画像は、バーストアクセス制御63によって、所定のタイミングで外部メモリ70に書き込まれる。
 図4は、集積回路60が外部メモリ70にアクセスする処理の一例を示す図である。集積回路60は、外部メモリ70から画像1と画像2を5画素ずつ連続的に読み込み(バーストアクセス)、FIFOで構成されたバッファへ投入して積算及び反転処理を並列的に実行する。なお、バーストアクセスのデータは5個に限定されるものではなく、外部メモリ70の仕様などに応じて適宜設定することができる。
 バーストアクセス制御63が読み込んだ画像1と画像2は、FIFOで構成されたバッファ64、65へ並列的に読み込まれる。そして、バッファ64、65に読み込まれた順に積算・反転処理61で画像1と画像2を取得して処理を実行し出力画像を生成する。
 本実施例の高位合成コードから得られたHDLコードを集積回路60へ適用することで、複数の画素を連続的に読み込むバーストアクセスと、演算処理を並列的に実行させることで、ハードウェア50の処理能力を向上させることができる。
 図5は、高位合成装置1で行われる処理の一例を示すフローチャートである。この処理は、高位合成装置1の利用者等の指令に基づいて開始される。処理の開始に先立って、高位合成コードが高位合成コード記憶部210に格納され、集積回路60が外部メモリ70から読み込むデータを格納する変数の情報(外部メモリアクセス変数情報221)等が外部メモリ情報記憶部220に予め格納されている。
 高位合成装置1の処理は、高位合成コード調整部10が、高位合成コードと外部メモリアクセス変数情報221を受け付けて、高位合成コードの解析結果に基づいて当該高位合成コードを再構成する処理と、再構成された高位合成コードを高位合成部160へ入力してHDLコードを生成する処理が行われる。
 まず、ループ処理抽出部110が高位合成コード記憶部210から高位合成コードを読み込んで、高位合成コードに含まれるループ処理を抽出し、ループの抽出結果231をコード再構成データベース230のコード再構成情報235に格納する(S100)。
 次に、外部メモリアクセス変数決定部120は、外部メモリ情報記憶部220から外部メモリアクセス変数情報221を読み込んで、高位合成コードのループ処理で使用する変数を決定し、外部メモリアクセス変数決定結果232としてコード再構成データベース230のコード再構成情報235に書き込む(S200)。
 なお、外部メモリアクセス変数情報221としては、外部メモリ70からデータを読み込む配列変数(図10A~図10C)等であり、予め設定された情報である。また、外部メモリ情報記憶部220は、ハードウェア50(基板上)に搭載する外部メモリ70と、外部メモリ70をアクセスする集積回路60の設計情報等に基づいて予め設定される。
 アクセスパターン解析部130は、高位合成コードのループ処理で外部メモリ70からデータを読み込む際のアクセスパターンを解析し、解析結果をアクセスパターン結果233としてコード再構成データベース230のコード再構成情報235に書き込む(S300)。アクセスパターン結果233は、例えば、外部メモリ70のアドレスをインクリメントまたはデクリメントあるいはランダム等に分類することができる。
 次に、バーストアクセス判定部140が、アクセスパターン結果233に基づいてバーストアクセスが可能か否かを判定し、バーストアクセス判定結果234をコード再構成データベース230のコード再構成情報235に書き込む(S400)。
 コード再構成部150は、コード再構成データベース230からコード再構成情報235を読み込んで、バーストアクセス判定結果234がバーストアクセス可能であれば、アクセス方法とアクセスパターンに基づいて、バーストアクセスのコードを高位合成コードのループ処理に追加する(S500)。また、コード再構成部150は、高位合成コード211中の変数をバッファに変更する。また、コード再構成部150は、高位合成コード211中の処理を使用するバッファの種類に応じて並列化処理またはパイプライン処理に変更する。
 上述のように、ステップS500では、コード再構成部150が、バーストアクセス処理の追加や、バッファへの変更、並列化またはパイプライン化などのコードの再構成(変更)を実施する。コード再構成部150は、バーストアクセス等でコードを再構成した高位合成コードを生成して、高位合成部160へ出力する。
 高位合成部160は、コード再構成部150から出力された高位合成コードを解析して、HDLコードを出力し、HDLコード記憶部240に格納する(S600)。
 上記処理により、高位合成コードのループ処理の抽出と、バーストアクセスの追加及び並列処理のコードの再構成が自動的に実行されて、コードが再構成された高位合成コードから高位合成部160がHDLコード241を生成してHDLコード記憶部240に格納する。
 なお、本実施例では、高位合成コードと外部メモリアクセス変数情報221を記憶装置200に予め格納しておいた例を示すが、処理の開始時に高位合成コードと外部メモリアクセス変数情報221を外部や入力装置300から受け付けるようにしてもよい。
 図8は、高位合成装置1に入力される高位合成コード211の一例を示す図である。高位合成コード211は、集積回路60で実行する処理を記述したソースコードで、高位合成コード記憶部210に予め格納されている。
 本実施例の高位合成コード211は、集積回路60が2つの画像(図中img1、img2)を外部メモリ70から読み込みながら、同一の座標の画素を加算して反転させて出力画像を生成する処理を示す。高位合成コード211には、2つのループ処理500、501が含まれる。
 ループ処理500にはラベル「LOOP1」が設定され、ループ処理501には、ラベル「LOOP11」が設定される。
 本実施例では、高位合成コード211をC++言語で記述した例を示すが、これに限定されるものではなく、C言語やSystemC言語、Matlab言語あるいはPython言語等で記述することができる。
 図9は、高位合成装置1が使用するコード再構成情報235の一例を示す図である。コード再構成情報235は、高位合成コード211から抽出したループ処理の識別子を格納するループ#2351と、ループ処理の名称を格納するループ名2352と、データを格納する変数の識別子を格納する変数#2353と、データを格納する変数の名称を格納する外部メモリアクセス変数2354と、外部メモリ70へのアクセス方法及びアクセスパターンを格納するアクセス方法/アクセスパターン2355と、バーストアクセスの可否を格納するバーストアクセス2356と、バッファの形式を格納するバッファ2357と、バッファの名称を格納するバッファ名2358と、バッファの容量を格納するバッファサイズ2359をひとつのエントリに含む。
 ループ#2351は、ループ処理抽出部110によって付与される識別子で、高位合成コード211から抽出されたループ毎に設定される。ループ名2352は、ループ処理抽出部110が高位合成コード211から取得したループの名称(ラベル)を格納する。
 変数#2353は、外部メモリアクセス変数決定部120が設定した識別子が格納される。外部メモリアクセス変数2354には、外部メモリアクセス変数決定部120が高位合成コード211から取得した変数の名称が格納される。
 アクセス方法/アクセスパターン2355には、アクセスパターン解析部130が解析したループ処理中の外部メモリ70へのアクセス方法とアクセスパターンが格納される。バーストアクセス2356には、バーストアクセス判定部140が決定したバーストアクセスの可否が格納される。バーストアクセスが可能であれば「OK」が格納され、不可であれば「NG」が格納される。
 バッファ2357には、バーストアクセス判定部140が決定した外部メモリアクセス変数2354に割り当てるバッファの形式が格納される。バッファの形式としては、FIFOやダブルバッファなどを設定することができる。
 バッファ名2358には、バーストアクセス判定部140が高位合成コード211に基づいて決定したバッファの名称が格納される。バッファサイズ2359には、バーストアクセス判定部140が高位合成コード211に基づいて決定した容量が格納される。
 図10Aは、外部メモリ70のアクセスパターンがインクリメントの例を示す図である。図示の例は、変数Xのデータ配列131に対して、アドレス(またはインデックス)iをインクリメント(加算)して隣り合うアドレスに順次アクセスするパターンを示す。アクセスする方向134は、アドレスが増大する方向となる。
 図10Bは、外部メモリ70のアクセスパターンがデクリメントの例を示す図である。図示の例は、変数Yのデータ配列132に対して、アドレス(またはインデックス)iをデクリメント(減算)して隣り合うアドレスに順次アクセスするパターンを示す。アクセスする方向134は、アドレスが減少する方向となる。
 図10Cは、外部メモリ70のアクセスパターンがランダムなアドレスの例を示す図である。図示の例は、変数Zのデータ配列133に対して、アドレス(またはインデックス)iがランダムに増減する方向134でアクセスを行う例を示す。
 アクセスパターン解析部130では、ループ処理内の外部メモリ70のアクセスパターンが上記図10A~図10Cのいずれであるかを判定し、判定結果をコード再構成情報235のアクセス方法/アクセスパターン2355に書き込む。
 本実施例では、図10Aや図10Bで示すように、隣り合うアドレスのデータを順次アクセスするループ処理を、バーストアクセスに変更して隣り合うアドレスのデータを複数個まとめてアクセスする。
 本実施例のバーストアクセスは、図4で示したように、1回のバーストリード命令で、アドレスが連続する5個のデータを読み込む例を示している。本実施例では、外部メモリ70から画像のデータを読み込む際には、図10Aのアドレスをインクリメントする方向へバーストアクセスを行う。また、画像の反転処理では、図10Bのように、アドレスをデクリメントする方向でアクセスする。
 なお、アクセスパターン解析部130は、高位合成コード211の構文解析やコードをコンパイルしてからアドレスを解析することでアクセスパターンを解析することができる。
 図6は、高位合成装置1で行われるバーストアクセス判定処理の一例を示すフローチャートである。この処理は、図5のステップS400に示したバーストアクセス判定部140の処理である。
 バーストアクセス判定部140は、コード再構成情報235から外部メモリアクセス変数2354をひとつ選択して当該エントリを読み込む(S401)。バーストアクセス判定部140は、アクセス方法/アクセスパターン2355のアクセスパターンがインクリメントであるか否かを判定する(S402)。インクリメントであればステップS404へ進み、そうでない場合にはステップS403に進む。
 ステップS404では、バーストアクセス判定部140が当該変数をバーストアクセスが可能な変数と判定して、コード再構成情報235のバーストアクセス2356に「OK」を格納する。ステップS405では、バーストアクセス判定部140がバッファの形式をFIFOに決定して、コード再構成情報235のバッファ2357に書き込む。
 一方、ステップS403では、バーストアクセス判定部140はアクセスパターンがデクリメントであるか否を判定する。デクリメントであればステップS405へ進み、そうでない場合にはステップS409に進む。
 ステップS405では、バーストアクセス判定部140が当該変数をバーストアクセスが可能な変数と判定して、コード再構成情報235のバーストアクセス2356に「OK」を格納する。ステップS407では、バーストアクセス判定部140がバッファの形式をダブルバッファに決定して、コード再構成情報235のバッファ2357に書き込む。
 次に、ステップS408では、バーストアクセス判定部140が、ループ処理の回数をバッファサイズ2359としてコード再構成情報235に登録する。
 ステップS409では、バーストアクセス判定部140がコード再構成情報235の全ての変数について処理が完了したか否かを判定して、完了していなければステップS401へ戻って上記処理を繰り返し、完了していれば処理を終了する。
 アクセスパターンがインクリメントの場合、集積回路60は、アクセスしたデータを順次演算で使用することになるため、FIFO(先入れ先出し)にすることでバーストアクセスしながら「並列」に演算することが可能になる。
 逆にデクリメントの場合、データのアクセス方向を逆にしなければならない。バーストアクセスはインクリメント方向のみ可能であるため、FIFOの順番では演算順序が逆になってしまう。そこで、バーストアクセス判定部140は、ダブルバッファの構成を設定する。ダブルバッファでは、データアクセス用のバッファと演算用バッファの2つを設定し、交互に切り替えることでバーストアクセスと演算を同時に処理することが可能になる。すなわち、本実施例では、バーストアクセスと演算処理をパイプライン化することで処理の高速化を実現する。
 図7は、高位合成装置で行われるコード再構成処理の一例を示すフローチャートである。この処理は、図5のステップS500に示したコード再構成部150の処理である。
 ステップS501でコード再構成部150は、コードの再構成処理が未実施で、かつ、外部メモリアクセス変数2354を内包するループ処理があるか否かを判定し、未実施のループ処理があればステップS502へ進み、そうでない場合には処理を終了する。
 ステップS502では、コード再構成部150が、コード再構成情報235から未実施のループ処理(ループ名2352)をひとつ選択する。
 ステップS503では、コード再構成部150が、コード再構成情報235のバーストアクセス2356を読み込んで、バーストアクセスが可能であるか否かを判定する。バーストアクセス2356が「OK」であればステップS504に進み、そうでなければステップS505へ進む。
 ステップS505では、コード再構成部150がループ処理の高速化を行ってからステップS501へ戻って上記の処理を繰り返す。なお、ループ処理の高速化の一例としては、ループ処理内の演算をパイプライン化、もしくは並列化する等の処理を行えばよい。
 ステップS504では、コード再構成部150が、選択されたループ処理から外部メモリアクセス変数2354をひとつ選択する。ステップS506では、コード再構成部150が、選択された変数がリードとライトのいずれであるかを判定する。リードであればステップS507へ進み、ライトであればステップS508へ進む。
 ステップS507では、コード再構成部150が、現在選択されているループ処理の外側にバーストリードのコードを高位合成コード211に追加する。一方、ステップS508では、コード再構成部150が、現在選択されているループ処理の外側にバーストライトのコードを高位合成コード211に追加する。
 次に、ステップS509では、コード再構成部150が、コード再構成情報235からバッファ名2538を読み込んで、バーストアクセスで使用するバッファ変数として高位合成コード211に追加する。
 ステップS510では、コード再構成部150が、高位合成コード211の外部メモリアクセス変数2354を、バッファ変数(2358)に置き換える。そして、ステップS511では、コード再構成部150が、コード再構成情報235のバッファ2357を参照して、現在選択している変数のバッファがFIFOであるか否かを判定する。コード再構成部150は、バッファがFIFOであればステップS512へ進み、FIFOでなければステップS513に進む。
 ステップS512では、コード再構成部150が、高位合成コード211にバーストアクセスによるループの並列処理を追加する。一方、ステップS513では、コード再構成部150が、高位合成コード211にバーストアクセスによるループのパイプライン処理を追加する。
 そして、コード再構成部150は、ステップS503へ戻って、同一のループ処理(2352)の他の変数について処理を行う。コード再構成部150は、処理対象の全てのループ処理について上記処理を実行する。
 上記処理によって、入力された図8の高位合成コード211は、図11に示すように再構成される。図11は、高位合成装置1が再構成した高位合成コード212の一例を示す図である。
 図中符号510のコード群は、図7のステップS509で追加されたバッファを示す。図中符号511のコード「#pragama」はステップS512またはS513の並列処理またはパイプライン処理の制御コードである。「#pragama」はプリプロセッサ指示子で、ループ処理のパイプライン化や並列化は、当該指示子に基づいて実施される。なお、高位合成部160の種類によって表記は異なる。
 図中符号512のコード群は、図7のステップS507で追加されたバーストリードの制御コードを示す。また、図中符号513のコード群は、図7のステップS505及びS510による変数をバッファに置換し、処理の高速化を行う例を示す。図中符号513のコード群は、図7のステップS508で追加されたバーストライトの制御コードを示す。
 図12は、従来例を示し、従来例によるハードウェアの構成の一例を示すブロック図である。前記従来例によって、集積回路60から外部メモリ70にアクセスして積算及び反転処理を行うHDLコードを生成し、ハードウェア50に適用した例を示す。
 図3に示した本実施例のHDLコードによるハードウェア50とは異なり、バーストアクセス制御やバッファ類はない。
 図13は、従来例を示し、従来例によるハードウェアの処理の一例を示す図である。図12のハードウェア50で、画像1と画像2を読み込んで、積算、反転処理を加えた出力画像を生成する処理では、1画素ずつ読み込んで演算処理を実施している。
 これに対して本実施例によるHDLコードを適用したハードウェア50では、図4で示したように、5画素を連続して読み込んで、読み込みの途中から演算処理を開始できるため、処理速度を大幅に向上させることが可能となる。
 以上のように、本実施例によれば、外部メモリ70へのアクセスを効率よく行う高位合成コード212を生成することで、集積回路60に外部メモリ70を付加したハードウェア50に最適なハードウェア記述言語を自動的に生成することが可能となる。
 図14は、本発明の実施例2を示し、高位合成装置の一例を示すブロック図である。実施例2では、高位合成コード調整部10に前記実施例1のバーストアクセス判定部140に代わってデータ幅判定部170を設け、コード再構成情報235は、図17で示すように前記実施例1のバーストアクセス2356を並列アクセス可能数2360に置き換え、バッファ2357、バッファ名2358、バッファサイズ2359をテンポラリレジスタ名2361に置き換えたもので、その他の構成は前記実施例1と同様である。
 データ幅判定部170は、外部メモリ70と集積回路60を接続するメモリバス80のデータ幅を有効に利用できるように、外部メモリアクセス変数のデータ型と比較して、並列にアクセス可能なデータ数を判別する。
 例えば、メモリバス80のデータ幅が16ビットで、1画素が8ビットの場合、集積回路60が2画素を並列的にアクセスすることで、処理速度を前記従来例に比して高速化させることが可能となる。
 集積回路60が外部メモリ70からアクセスするデータのアドレスは連続している必要があるため、アクセスパターン解析部130では前記実施例1と同様にアクセスパターンを解析する。
 図15は、高位合成装置1で行われる処理の一例を示すフローチャートである。ステップS100~S300は、前記実施例1の図5と同様である。
 データ幅判定部170が、ステップS300のアクセスパターン結果に基づいて複数の画素を並列にアクセスすることが可能か否かを判定し、可能な場合は並列アクセス可能数を算出し、データ幅判定結果236をコード再構成データベース230のコード再構成情報235の並列アクセス可能数2360に書き込む(S400)。
 コード再構成部150は、コード再構成データベース230からコード再構成情報235を読み込んで、並列アクセス可能数2360が2以上であれば並列アクセスが可能であるので、アクセス方法とアクセスパターンに基づいて、並列アクセスのコードを高位合成コードのループ処理に追加する(S700)。また、コード再構成部150は、高位合成コード211中の変数をテンポラリレジスタに変更する。
 コード再構成部150は、並列アクセスの追加、テンポラリレジスタへの変更などのコードの再構成(変更)を実施する(S800)。
 コード再構成部150は、並列アクセス等でコードを再構成した高位合成コードを生成して、高位合成部160へ出力する。
 高位合成部160は、コード再構成部150から出力された高位合成コードを解析して、HDLコードを出力し、HDLコード記憶部240に格納する(S600)。
 上記処理により、高位合成コードのループ処理の抽出と、並列アクセスの追加等の再構成が自動的に実行されて、コードが再構成された高位合成コードから高位合成部160がHDLコード241を生成する。
 図16は、高位合成装置1で行われるデータ幅判定処理の一例を示すフローチャートである。この処理は、図15のステップS700に示したデータ幅判定部170の処理である。
 データ幅判定部170は、コード再構成情報235から外部メモリアクセス変数2354をひとつ選択して当該エントリを読み込む(S701)。データ幅判定部170は、アクセス方法/アクセスパターン2355のアクセスパターンがインクリメントまたはデクリメントであるか否かを判定する(S702)。インクリメントまたはデクリメントであればステップS703へ進み、そうでない場合にはステップS705に進む。
 ステップS703では、データ幅判定部170が当該変数を並列アクセスが可能な変数と判定して、読み込む1データのビット数とメモリバス80のデータ幅に基づいて並列アクセス可能数を算出する。データ幅判定部170は、コード再構成情報235の並列アクセス可能数2360へ同時にアクセス可能な画素数を格納する。なお、本実施例では、画素数を用いるが、画像データ以外の場合はデータ数を格納すればよい。
 ステップS704では、データ幅判定部170が、並列アクセスを実行するレジスタをコード再構成情報235のテンポラリレジスタ名2361へ登録する。テンポラリレジスタ名2361は、入出力を行う外部メモリアクセス変数2354に応じて設定することができる。
 ステップS705では、データ幅判定部170がコード再構成情報235の全ての変数について処理が完了したか否かを判定して、完了していなければステップS701へ戻って上記処理を繰り返し、完了していれば処理を終了する。
 図17は、高位合成装置のコード再構成情報の一例を示す図である。コード再構成情報235は、実施例1のバーストアクセス2356を並列アクセス可能数2360に置き換え、バッファ2357、バッファ名2358、バッファサイズ2359をテンポラリレジスタ名2361に置き換えたものである。
 図示の例では、変数のデータ型が8ビットで、メモリバス80のデータ幅が16ビットの例を示し、同時にアクセス可能なデータ数は「2」となる。
 図18は、高位合成装置1のコード再構成処理の一例を示す図である。この処理は、図15のステップS800に示したコード再構成部150の処理である。
 ステップS801でコード再構成部150は、コードの再構成処理が未実施で、かつ、外部メモリアクセス変数2354を内包するループ処理があるか否かを判定し、未実施のループ処理があればステップS802へ進み、そうでない場合には処理を終了する。
 ステップS802では、コード再構成部150が、コード再構成情報235から未実施のループ処理(ループ名2352)をひとつ選択する。
 ステップS803では、コード再構成部150が、コード再構成情報235の並列アクセス可能数2360を読み込んで、並列アクセスが可能であるか否かを判定する。並列アクセス可能数2360が2以上であればステップS804に進み、そうでなければステップS801へ戻って、次のループについて上記処理を実施する。
 ステップS804では、コード再構成部150が、選択されたループ処理から外部メモリアクセス変数2354をひとつ選択する。ステップS805では、コード再構成部150が、選択された変数のデータ型(ビット数)を並列アクセス可能数2360に応じて変更する。
 ステップS806では、コード再構成部150が、現在選択されている変数に対応するテンポラリレジスタ変数を高位合成コード211に追加する。
 次に、ステップS807では、コード再構成部150が、データ型を変更した外部メモリアクセス変数を上記テンポラリレジスタに置換する。
 ステップS808では、コード再構成部150が、コード再構成情報235のアクセス方法/アクセスパターン2355を参照して、外部メモリアクセス変数のアクセスがリードであるか否かを判定する。コード再構成部150は、アクセスがリードであればステップS809へ進み、ライトであればステップS810に進む。
 ステップS809では、コード再構成部150が、外部メモリアクセス変数2354からテンポラリレジスタへの代入処理を高位合成コード211へ追加する。なお、コード再構成部150は、複数の画素を同時にアクセスするために、画素毎にシフトさせるなどの所定のビット操作を追加する。
 一方、ステップS810では、コード再構成部150が、テンポラリレジスタから外部メモリアクセス変数2354への代入処理を高位合成コード211へ追加する。なお、コード再構成部150は、複数の画素を同時にアクセスするために、画素毎にシフトさせるなどの所定のビット操作を追加する。
 次に、ステップS811では、コード再構成部150が、現在のループ処理で並列アクセスが可能な未処理の変数があるか否かを判定し、未処理の変数があればステップS804に戻って上記処理を繰り返し、未処理の変数がなければステップS812へ進む。
 ステップS812では、コード再構成部150が、高位合成コード211のループ処理の回数を、ループ処理回数/並列アクセス数に変更する。そして、上記ステップS801へ戻って上記処理を繰り返して、処理対象の全てのループ処理について上記処理を実行する。
 上記処理によって、入力された図8の高位合成コード211は、図19に示すように再構成される。図19は、高位合成装置1が再構成した高位合成コード213の一例を示す図である。
 本実施例の高位合成コード213は、集積回路60がアクセスしたデータを並列数に応じて用意したテンポラリレジスタに読み込んで、並列的に演算を実施する処理に再構成されたものである。
 図中符号520のコードは、図18のステップS805で変更されたデータ型(ビット数)を示す。図中符号521のコード群は、図18のステップS806によって追加されたテンポラリレジスタを示す。
 図中符号522のコードは、図18のステップS812で変更されたループ数を示す。図中符号523のコード群は、図18のステップS809による、外部メモリアクセス変数からテンポラリレジスタへの代入処理を示す。
 図中符号524のコード群は、図18のステップS807による外部メモリアクセス変数のテンポラリレジスタへの置換と演算の並列化の記述を示す。図中符号525のコード群は、図18のステップS810によるテンポラリレジスタから外部メモリアクセス変数への代入処理を示す。
 以上のように、本実施例では、高位合成コード調整部10が、外部メモリ70のメモリバス80のデータ幅に合わせて並列演算数を増やすことで処理時間を短縮してハードウェア50の処理性能を向上させることが可能となる。
 図20は、本発明の実施例3を示し、高位合成装置1の一例を示すブロック図である。本実施例では、集積回路60の制約条件として最大バッファサイズが指定されていた場合に、再構成後の高位合成コードが制約条件を満足するようにループ数を分割させる例を示す。
 本実施例の高位合成装置1は、前記実施例1の構成に、制約条件記憶部250と、制約条件判定部180と、コード修正案決定部190を加えたもので、その他の構成は前記実施例1と同様である。なお、制約条件判定部180と、コード修正案決定部190は、高位合成コード調整部10内に追加される。
 制約条件記憶部250には、集積回路60で設定可能なバッファサイズの最大値が格納されている。制約条件判定部180は、コード再構成部150が出力した高位合成コード212を読み込んで、記述されたバッファサイズが制約条件記憶部250の条件を満たしているか否かを判定する。
 制約条件判定部180は、高位合成コード212のバッファサイズが制約条件記憶部250の最大値を超えている場合、コード修正案決定部190に通知する。コード修正案決定部190は、バッファサイズが制約条件記憶部250の最大値を超えているループ処理を特定し、ループ処理の分割等を提案する。なお、提案の内容は、表示装置400へ出力すればよい。
 本実施例では、集積回路60の制約条件を超えた場合、高位合成装置1の利用者に、ループ処理の修正個所を提案することが可能となる。
 図21は、本発明の実施例4を示し、高位合成装置の一例を示すブロック図である。本実施例では、実施例1のバーストアクセス制御と、実施例2の並列アクセスを組み合わせたものである。
 高位合成コード調整部10内ではデータ幅判定部170の後段にバーストアクセス判定部140が配置される。その他の構成は前記実施例1、2と同様である。
 本実施例の構成によれば、バーストアクセスに加えて、テンポラリレジスタによる並列アクセスによって、集積回路60の処理性能をさらに向上させることが可能となる。
 <結び>
 以上のように、上記実施例1~4の高位合成装置は、以下のような構成とすることができる。
 (1)プロセッサ(処理装置100)とメモリ(主記憶101)を有し、外部メモリ(70)に接続された集積回路(60)の構成を記述したハードウェア記述コードを生成する高位合成装置(1)であって、前記集積回路(60)に実行させる処理を記述した高位合成コード(211)と、前記外部メモリ(70)との間でデータの授受を行う外部メモリアクセス変数(221)とを受け付けて、前記高位合成コード(211)を解析し、解析結果に基づいて前記高位合成コード(211)を再構成する高位合成コード調整部(10)を有し、前記高位合成コード調整部(10)は、前記高位合成コード(211)内の外部メモリアクセス変数(221)を解析し、前記外部メモリ(70)にバーストアクセスが可能か否かを判定するバーストアクセス判定部(140)と、前記バーストアクセスが可能な外部メモリアクセス変数(221)に対して、バーストアクセスを実行するコードを前記高位合成コード(211)に付加して再構成するコード再構成部(150)と、を含む。
 上記構成によれば、高位合成コード211の外部メモリアクセス変数でバーストアクセスが可能であれば、高位合成装置は、高位合成コード211にバーストアクセスを実行するコードを付加して高位合成コード212を再構成することができる。バーストアクセスによりデータをまとめてアクセスすることで、集積回路60で行われる処理を高速化することができる。
 (2)上記(1)に記載の高位合成装置(1)であって、コード再構成部(150)で再構成された前記高位合成コード(212)を入力して、前記ハードウェア記述コードを生成する高位合成部(160)を、さらに有する。
 上記構成によれば、高位合成部160は、バーストアクセスのコードを付加された高位合成コード212を入力として集積回路60のHDLコードを生成することができる。集積回路60に当該HDLコードを適用することで、集積回路60はバーストアクセスによりデータをまとめてアクセスすることで、処理を高速化することができる。
 (3)上記(1)に記載の高位合成装置(1)であって、前記高位合成コード調整部(10)は、前記高位合成コード(211)内のループ処理を抽出するループ処理抽出部(110)と、前記ループ処理内に記述された前記外部メモリアクセス変数(221)を決定する外部メモリアクセス変数決定部(120)と、さらに含む。
 上記構成によれば、高位合成コード211のループ処理内に記述された外部メモリアクセス変数をバーストアクセスの対象とすることで、バーストアクセスのコードを付加して高位合成コード212を再構成することができる。
 (4)上記(3)に記載の高位合成装置(1)であって、前記高位合成コード調整部(10)は、前記外部メモリアクセス変数(221)において、前記外部メモリ(70)へのアクセスパターンを解析するアクセスパターン解析部(130)を、さらに含む。
 上記構成によれば、高位合成コード211のループ処理内に記述された外部メモリアクセス変数をバーストアクセスの対象とし、バーストアクセスのパターンを判定することが可能となる。
 (5)上記(4)に記載の高位合成装置(1)であって、前記バーストアクセス判定部(140)は、前記アクセスパターンに応じて予め設定されたバッファを決定し、前記コード再構成部(150)は、前記決定された前記バッファの種類に応じてパイプライン処理または並列処理のコードを追加する。
 上記構成によれば、コード再構成部150が、バーストアクセス処理の追加や、バッファへの変更、並列化またはパイプライン化などのコードの再構成(変更)を実施する。コード再構成部150は、バーストアクセス等でコードを再構成した高位合成コード212を生成して高位合成部160へ出力することができる。高位合成コード212からHDLコードを生成することで、集積回路60が外部メモリ70を効率よくアクセスして高速に演算処理を実行することが可能となる。
 なお、本発明は上記した実施例に限定されるものではなく、様々な変形例が含まれる。例えば、上記した実施例は本発明を分かりやすく説明するために詳細に記載したものであり、必ずしも説明した全ての構成を備えるものに限定されるものではない。また、ある実施例の構成の一部を他の実施例の構成に置き換えることが可能であり、また、ある実施例の構成に他の実施例の構成を加えることも可能である。また、各実施例の構成の一部について、他の構成の追加、削除、又は置換のいずれもが、単独で、又は組み合わせても適用可能である。
 また、上記の各構成、機能、処理部、及び処理手段等は、それらの一部又は全部を、例えば集積回路で設計する等によりハードウェアで実現してもよい。また、上記の各構成、及び機能等は、プロセッサがそれぞれの機能を実現するプログラムを解釈し、実行することによりソフトウェアで実現してもよい。各機能を実現するプログラム、テーブル、ファイル等の情報は、メモリや、ハードディスク、SSD(Solid State Drive)等の記録装置、または、ICカード、SDカード、DVD等の記録媒体に置くことができる。
 また、制御線や情報線は説明上必要と考えられるものを示しており、製品上必ずしも全ての制御線や情報線を示しているとは限らない。実際には殆ど全ての構成が相互に接続されていると考えてもよい。
 <補足>
 特許請求の範囲に記載した以外の本発明の観点の代表的なものとして、次のものがあげられる。
 <13>
 プロセッサとメモリを有する高位合成装置が、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成方法であって、
 前記高位合成装置が、前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付ける入力ステップと、
 前記高位合成装置が、前記高位合成コード内の外部メモリアクセス変数のデータ型と前記外部メモリのデータ幅から、並列にアクセス可能なデータ数を算出するデータ幅判定ステップと、
  前記高位合成装置が、前記並列にアクセスが可能な前記外部メモリアクセス変数に対して、並列に所定の処理を実行するコードを前記高位合成コードに付加して再構成するコード再構成ステップと、
を含むことを特徴とする高位合成方法。
 <14>
 上記<13>に記載の高位合成方法であって、
 前記高位合成装置が、前記再構成された前記高位合成コードを入力して、前記ハードウェア記述コードを生成する高位合成ステップを、さらに含むことを特徴とする高位合成方法。
 <15>
 プロセッサとメモリとストレージ装置を備えた計算機で、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成させるためのプログラムを格納した記憶媒体であって、
 前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付ける入力ステップと、
 前記高位合成コード内の外部メモリアクセス変数を解析し、前記外部メモリにバーストアクセスが可能か否かを判定するバーストアクセス判定ステップと、
 前記バーストアクセスが可能な外部メモリアクセス変数に対して、バーストアクセスを実行するコードを前記高位合成コードに付加して再構成するコード再構成ステップと、
を前記計算機に実行させるためのプログラムを格納した非一時的な計算機読み取り可能な記憶媒体。

Claims (12)

  1.  プロセッサとメモリを有し、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成装置であって、
     前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付けて、前記高位合成コードを解析し、解析結果に基づいて前記高位合成コードを再構成する高位合成コード調整部を有し、
     前記高位合成コード調整部は、
     前記高位合成コード内の外部メモリアクセス変数を解析し、前記外部メモリにバーストアクセスが可能か否かを判定するバーストアクセス判定部と、
     前記バーストアクセスが可能な外部メモリアクセス変数に対して、バーストアクセスを実行するコードを前記高位合成コードに付加して再構成するコード再構成部と、
    を含むことを特徴とする高位合成装置。
  2.  請求項1に記載の高位合成装置であって、
     前記コード再構成部で再構成された前記高位合成コードを入力して、前記ハードウェア記述コードを生成する高位合成部を、さらに有することを特徴とする高位合成装置。
  3.  請求項1に記載の高位合成装置であって、
     前記高位合成コード調整部は、
     前記高位合成コード内のループ処理を抽出するループ処理抽出部と、
     前記ループ処理内に記述された前記外部メモリアクセス変数を決定する外部メモリアクセス変数決定部と、
    をさらに含むことを特徴とする高位合成装置。
  4.  請求項3に記載の高位合成装置であって、
     前記高位合成コード調整部は、
     前記外部メモリアクセス変数において、前記外部メモリへのアクセスパターンを解析するアクセスパターン解析部を、さらに含むことを特徴とする高位合成装置。
  5.  請求項4に記載の高位合成装置であって、
     前記バーストアクセス判定部は、
     前記アクセスパターンに応じて予め設定されたバッファを決定し、
     前記コード再構成部は、
     前記決定された前記バッファの種類に応じてパイプライン処理または並列処理のコードを追加することを特徴とする高位合成装置。
  6.  プロセッサとメモリを有し、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成装置であって、
     前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付けて、前記高位合成コードを解析し、解析結果に基づいて前記高位合成コードを再構成する高位合成コード調整部を有し、
     前記高位合成コード調整部は、
     前記高位合成コード内の外部メモリアクセス変数のデータ型と前記外部メモリのデータ幅から、並列にアクセス可能なデータ数を算出するデータ幅判定部と、
     前記並列にアクセスが可能な前記外部メモリアクセス変数に対して、並列に所定の処理を実行するコードを前記高位合成コードに付加して再構成するコード再構成部と、
    を含むことを特徴とする高位合成装置。
  7.  請求項6に記載の高位合成装置であって、
     前記コード再構成部で再構成された前記高位合成コードを入力して、前記ハードウェア記述コードを生成する高位合成部を、さらに有することを特徴とする高位合成装置。
  8.  プロセッサとメモリを有する高位合成装置が、外部メモリに接続された集積回路の構成を記述したハードウェア記述コードを生成する高位合成方法であって、
     前記高位合成装置が、前記集積回路に実行させる処理を記述した高位合成コードと、前記外部メモリとの間でデータの授受を行う外部メモリアクセス変数とを受け付ける入力ステップと、
     前記高位合成装置が、前記高位合成コード内の外部メモリアクセス変数を解析し、前記外部メモリにバーストアクセスが可能か否かを判定するバーストアクセス判定ステップと、
     前記高位合成装置が、前記バーストアクセスが可能な外部メモリアクセス変数に対して、バーストアクセスを実行するコードを前記高位合成コードに付加して再構成するコード再構成ステップと、
    を含むことを特徴とする高位合成方法。
  9.  請求項8に記載の高位合成方法であって、
     前記高位合成装置が、前記再構成された前記高位合成コードを入力して、前記ハードウェア記述コードを生成する高位合成ステップを、さらに含むことを特徴とする高位合成方法。
  10.  請求項8に記載の高位合成方法であって、
      前記高位合成装置が、前記高位合成コード内のループ処理を抽出するループ処理抽出ステップと、
      前記高位合成装置が、前記ループ処理内に記述された前記外部メモリアクセス変数を決定する外部メモリアクセス変数決定ステップと、
    をさらに含むことを特徴とする高位合成方法。
  11.  請求項10に記載の高位合成方法であって、
     前記高位合成装置が、前記外部メモリアクセス変数において、前記外部メモリへのアクセスパターンを解析するアクセスパターン解析ステップを、さらに含むことを特徴とする高位合成方法。
  12.  請求項11に記載の高位合成方法であって、
     前記バーストアクセス判定ステップでは、
     前記アクセスパターンに応じて予め設定されたバッファを決定し、
     前記コード再構成ステップでは、
     前記決定された前記バッファの種類に応じてパイプライン処理または並列処理のコードを追加することを特徴とする高位合成方法。
PCT/JP2020/018589 2019-06-21 2020-05-07 高位合成装置及び高位合成方法 WO2020255576A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US17/621,010 US20220366111A1 (en) 2019-06-21 2020-05-07 High-level synthesis device and high-level synthesis method

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
JP2019115205A JP7150668B2 (ja) 2019-06-21 2019-06-21 高位合成装置及び高位合成方法
JP2019-115205 2019-06-21

Publications (1)

Publication Number Publication Date
WO2020255576A1 true WO2020255576A1 (ja) 2020-12-24

Family

ID=73995583

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2020/018589 WO2020255576A1 (ja) 2019-06-21 2020-05-07 高位合成装置及び高位合成方法

Country Status (3)

Country Link
US (1) US20220366111A1 (ja)
JP (1) JP7150668B2 (ja)
WO (1) WO2020255576A1 (ja)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220366111A1 (en) * 2019-06-21 2022-11-17 Hitachi, Ltd. High-level synthesis device and high-level synthesis method

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013235472A (ja) * 2012-05-10 2013-11-21 Nec Corp 装置情報管理装置、装置情報取得システム、装置情報取得方法およびプログラム
JP2014106639A (ja) * 2012-11-26 2014-06-09 Ricoh Co Ltd 高位合成装置、高位合成方法、及び高位合成プログラム
JP2016177454A (ja) * 2015-03-19 2016-10-06 富士通株式会社 動作合成方法、動作合成プログラムおよび動作合成装置
WO2017154183A1 (ja) * 2016-03-10 2017-09-14 三菱電機株式会社 高位合成装置、高位合成方法及び高位合成プログラム

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105556402A (zh) * 2013-12-09 2016-05-04 帝斯贝思数字信号处理和控制工程有限公司 用于影响控制设备的控制程序的方法
US10817587B2 (en) * 2017-02-28 2020-10-27 Texas Instruments Incorporated Reconfigurable matrix multiplier system and method
US11386644B2 (en) * 2017-10-17 2022-07-12 Xilinx, Inc. Image preprocessing for generalized image processing
US10846621B2 (en) * 2017-12-12 2020-11-24 Amazon Technologies, Inc. Fast context switching for computational networks
JP7150668B2 (ja) * 2019-06-21 2022-10-11 株式会社日立製作所 高位合成装置及び高位合成方法
US11762762B1 (en) * 2022-03-24 2023-09-19 Xilinx, Inc. Static and automatic inference of inter-basic block burst transfers for high-level synthesis
WO2024091969A1 (en) * 2022-10-25 2024-05-02 Dolby Laboratories Licensing Corporation Residual encoding and decoding using a neural field

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2013235472A (ja) * 2012-05-10 2013-11-21 Nec Corp 装置情報管理装置、装置情報取得システム、装置情報取得方法およびプログラム
JP2014106639A (ja) * 2012-11-26 2014-06-09 Ricoh Co Ltd 高位合成装置、高位合成方法、及び高位合成プログラム
JP2016177454A (ja) * 2015-03-19 2016-10-06 富士通株式会社 動作合成方法、動作合成プログラムおよび動作合成装置
WO2017154183A1 (ja) * 2016-03-10 2017-09-14 三菱電機株式会社 高位合成装置、高位合成方法及び高位合成プログラム

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20220366111A1 (en) * 2019-06-21 2022-11-17 Hitachi, Ltd. High-level synthesis device and high-level synthesis method

Also Published As

Publication number Publication date
US20220366111A1 (en) 2022-11-17
JP7150668B2 (ja) 2022-10-11
JP2021002185A (ja) 2021-01-07

Similar Documents

Publication Publication Date Title
EP3698313B1 (en) Image preprocessing for generalized image processing
US10809933B2 (en) Matrix transfer accelerator system and method
US10990410B2 (en) Systems and methods for virtually partitioning a machine perception and dense algorithm integrated circuit
CN101681449B (zh) 计算处理装置及方法
US20200249998A1 (en) Scheduling computation graph heterogeneous computer system
US10768894B2 (en) Processor, information processing apparatus and operation method for processor
US20180253641A1 (en) Arithmetic processing apparatus and control method therefor
JP6713036B2 (ja) 折り畳まれた特徴データに対して畳み込み演算を実行するための方法および装置
CN108388537B (zh) 一种卷积神经网络加速装置和方法
CN112840356A (zh) 运算加速器、处理方法及相关设备
CN111465943A (zh) 芯片上计算网络
WO2020073801A1 (zh) 一种3d图像处理中数据读写方法及系统、存储介质及终端
CN111133457B (zh) 电子设备及其控制方法
CN111656339A (zh) 存储器装置及其控制方法
CN111324294A (zh) 存取张量数据的方法和装置
WO2020255576A1 (ja) 高位合成装置及び高位合成方法
WO2016208260A1 (ja) 画像認識装置および画像認識方法
CN114118348A (zh) 加速器、操作加速器的方法以及包括加速器的电子装置
US9570125B1 (en) Apparatuses and methods for shifting data during a masked write to a buffer
Shahbahrami et al. FPGA implementation of parallel histogram computation
TWI634436B (zh) 緩衝裝置及卷積運算裝置與方法
Najafi et al. GPU-Accelerated nick local image thresholding algorithm
US11995148B2 (en) Electronic apparatus for performing deconvolution calculation and controlling method thereof
KR102290229B1 (ko) 병렬 처리를 위한 데이터 생성 장치
JP4773980B2 (ja) 演算処理装置、及び演算処理方法

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 20827746

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 20827746

Country of ref document: EP

Kind code of ref document: A1