WO2019043822A1 - メモリアクセス装置、画像処理装置、および撮像装置 - Google Patents

メモリアクセス装置、画像処理装置、および撮像装置 Download PDF

Info

Publication number
WO2019043822A1
WO2019043822A1 PCT/JP2017/031108 JP2017031108W WO2019043822A1 WO 2019043822 A1 WO2019043822 A1 WO 2019043822A1 JP 2017031108 W JP2017031108 W JP 2017031108W WO 2019043822 A1 WO2019043822 A1 WO 2019043822A1
Authority
WO
WIPO (PCT)
Prior art keywords
read
data
write
image processing
dma transfer
Prior art date
Application number
PCT/JP2017/031108
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 PCT/JP2017/031108 priority Critical patent/WO2019043822A1/ja
Publication of WO2019043822A1 publication Critical patent/WO2019043822A1/ja

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F13/00Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
    • G06F13/14Handling requests for interconnection or transfer
    • G06F13/20Handling requests for interconnection or transfer for access to input/output bus
    • G06F13/28Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal
    • G06F13/30Handling requests for interconnection or transfer for access to input/output bus using burst mode transfer, e.g. direct memory access DMA, cycle steal with priority control

Definitions

  • the present invention relates to a memory access device, an image processing device, and an imaging device.
  • an imaging apparatus such as a still image camera, a moving image camera, a medical endoscope camera, or an industrial endoscope camera
  • various image processing is performed by an image processing apparatus such as a system LSI mounted.
  • the image processing apparatus incorporates a plurality of processing blocks for performing various image processing in the imaging apparatus, and each processing block is connected to a data bus provided in the image processing apparatus.
  • each processing block connected to the data bus shares one DRAM (Dynamic Random Access Memory) connected to the outside of the image processing apparatus as a bus master.
  • each processing block (bus master) accesses the DRAM by DMA (Direct Memory Access) transfer via the data bus, and passes various data for image processing via the DRAM. I'm going.
  • DRAM Dynamic Random Access Memory
  • an image processing apparatus having a configuration in which one DRAM is shared by a plurality of processing blocks (bus masters) includes an arbitration circuit (so-called DMA arbitration circuit) that arbitrates access requests for DMA transfer output from the respective bus masters. ing.
  • the arbitration circuit controls the actual access to the DRAM while appropriately arbitrating the access request (so-called DMA request) to the DRAM output from each bus master.
  • the arbitration circuit basically determines a bus master that accepts (permits) an access request to the DRAM based on the priority that indicates the priority of each bus master.
  • the processing block (bus master) included in the image processing apparatus performs processing such as writing data back to the DRAM (writing back) after reading data from the DRAM and performing predetermined processing.
  • Such a processing block (bus master) needs to switch between reading data from the DRAM via the data bus and writing data to the DRAM via the data bus.
  • the DRAM can not be switched from the state of reading data to the state of writing data at an appropriate timing, which makes it difficult to secure a target bus bandwidth. This is a factor causing a failure in the system of the imaging device equipped with the image processing device.
  • Patent Document 1 a technique for improving the efficiency of access to a DRAM as disclosed in Patent Document 1 is disclosed.
  • the degree of urgency is determined based on the request transfer rate and the average transfer rate, and priority is given to a memory access request from a master with a high degree of urgency.
  • information processing apparatuses and information processing methods for performing bus arbitration have been proposed.
  • the present invention has been made based on the above problem recognition, and when a plurality of processing blocks share a DRAM, switching between reading of data from the DRAM and writing of data to the DRAM is appropriately performed. It is an object of the present invention to provide a memory access device, an image processing device, and an imaging device that can reduce factors that cause a system failure.
  • the memory access device outputs a request for access requesting the access to the memory connected to the data bus, and the processing for data in the memory accessed by the bus master is stopped.
  • the access requests in the bus master any one of the access requests for requesting read access for reading data from the memory and for writing access requests for requesting write access for writing data to the memory
  • a read / write switching control unit for notifying whether the priority is given, and the data bus connected to arbitrate the access request to the memory, and when the access request to the memory output from the bus master is received, Notified by the read / write switching control unit Preferred accepting the access request, and a bus arbiter for controlling access to said memory in response to an access request received.
  • the read / write switching control unit determines the state of the read access request output from the bus master and the state output from the bus master The state of the write access request, the amount of data stored in a read buffer for storing data of a predetermined amount of data read from the memory, provided in the bus master, and the memory provided in the bus master The amount of data stored in a write buffer storing data of a predetermined amount of data to be written is observed, and any one of the read access request and the write access request is accessed in the access request at the bus master Read / write switching signal for notifying whether to prioritize the request Outputs, the bus arbiter, when receiving the access request outputted from the bus master may receive the priority the access request notified by the read-write switching signal.
  • the bus master includes at least the read buffer, and a read bus master that outputs the read access request, and the write buffer. And a write bus master that outputs the write access request.
  • the read / write switching control unit determines the read access request based on the observed states.
  • a switching threshold value for determining which of the access requests with the write access request is to be prioritized is generated, the data amount of data stored in the read buffer, and the data amount of data stored in the write buffer When it is determined that the amount of data stored in the read buffer or the amount of data stored in the write buffer has reached the switching threshold.
  • the prioritized access request represented by the read / write switching signal may be switched.
  • the switching threshold is used to determine the data amount of data stored in the read buffer, and is stored in the read buffer.
  • the processing module performing processing on the stored data switches the amount of data that can read out the data stored in the read buffer and start processing, and switches the memory from the data writing state to the data reading state
  • the data stored in the write buffer which is used to determine the data amount of the data stored in the read buffer and the read switching threshold added with the amount of data that can be processed during the necessary time.
  • Is reading data from the memory from the amount of data that can start writing to the memory of Lights and switching threshold may be composed of the a is the processing module during a time obtained by subtracting the amount of data that can be processed required when switching from a state to a state of writing the data.
  • the switching threshold is used to determine the data amount of data stored in the read buffer, and is stored in the read buffer.
  • the amount of data that can be processed during the time required when the processing module that performs processing on the stored data switches the memory from the state in which the data is written to the state to the data, and reading from the memory Used for determining the data amount of the data stored in the write buffer and the read switching threshold value including the amount of data that can be processed before storing the stored data in all the storage capacities of the read buffer Amount of data that can be stored in the write buffer after the processing module has performed processing And a write switching threshold obtained by subtracting an amount of data that can be processed by the processing module during a time required to switch the memory from reading data to writing data. It is also good.
  • the read / write switching control unit stores in the read buffer based on each observed state.
  • the processed data is read and processed, and the processed data is stored in the write buffer to the processing module, whether or not a state in which the processing is kept waiting is generated, and delivered via the data bus It is determined whether or not the data amount of the data being performed is larger than the predetermined data amount, and a state in which the processing module is kept waiting for processing does not occur, or the processing module Although a waiting state has occurred, the amount of data being transferred via the data bus is equal to the predetermined amount of data.
  • a first switching threshold is generated to determine which one of the read access request and the write access request is to be prioritized, and the processing module waits for processing.
  • the read access request and the write access when it is determined that the data state being transferred is larger than the predetermined data amount, the data amount being transferred via the data bus is larger than the predetermined data amount.
  • the prioritized access represented by the read / write switching signal The request may be switched.
  • the first switching threshold is used to determine the amount of data stored in the read buffer
  • the processing module Between the amount of data that can read out the data stored in the read buffer and start processing and the time required to switch the memory from writing data to reading data
  • the first read switching threshold added with the amount of data that can be performed and the determination of the amount of data stored in the write buffer, and writing the data stored in the write buffer to the memory Switching from the state of reading data to the state of writing data from the amount of data that can be started
  • a second read switching threshold including the amount of data that can be processed before the data read from the memory is stored in all the storage capacities of the read buffer, and the data stored in the write buffer Can be used to determine the amount
  • the read / write switching controller performs the processing module set in advance.
  • the access request output from the bus master is calculated using an operation-related setting to calculate an urgency threshold for determining the urgency of the access request output by the bus master, and calculating based on each observed state.
  • An emergency for notifying that the degree of urgency is high when the waiting time of the access request not accepted by the bus arbiter is longer than the urgency threshold and low when the waiting time for the access request is not longer than the urgency threshold
  • the bus arbiter outputs a high degree of urgency by the urgency signal when arbitrating the access request to the memory. May be arbitrated by that higher priority outputted said access request from said bus master is notified.
  • the urgency threshold is defined such that a state in which processing performed by the processing module is not caused occurs.
  • the threshold time of the limit time until the end of the access to the memory may be a threshold value of the time to the limit time set based on the time required when switching the state of the memory.
  • the urgency level threshold terminates the processing speed and the processing amount in the processing module and the processing performed by the processing module.
  • the ratio to the request processing time set based on the request processing time required until and the time required to switch the state of the memory, the amount of the remaining processing in the processing module, and the processing of the processing module It may be a threshold value of time calculated based on the processing time from the start of the process to the present time.
  • the urgency threshold is a processing speed in the processing module when the processing module performs the processing in a plurality of times. And the amount of processing, the required processing time required to complete the processing performed by the processing module, and the ratio to the required processing time set based on the time required to switch the state of the memory, and It may be a threshold value of time calculated based on the amount of remaining processing obtained from the number of remaining processings in the processing module and the processing time from the start of the processing of the processing module to the present.
  • the urgency threshold is the processing The required processing time set based on the processing speed and amount of processing in the module, the required processing time required to finish the processing performed by the processing module, and the time required to switch the state of the memory Based on the ratio of total processing in the processing module to the amount of remaining processing obtained from the amount of processing completed up to the present, and the processing time from the start of the processing of the processing module to the present It may be a threshold of time calculated.
  • the image processing apparatus stops the processing for the data in the memory accessed by the bus master, and the bus master outputs an access request for requesting the access to the memory connected to the data bus.
  • the access requests in the bus master any one of the access requests for requesting read access for reading data from the memory and for writing access requests for requesting write access for writing data to the memory
  • a read / write switching control unit for notifying whether the priority is given, and the data bus connected to arbitrate the access request to the memory, and when the access request to the memory output from the bus master is received, Superior notified by read / write switching control unit
  • a memory access device provided with the a bus arbiter for controlling access to said memory in response to the access request accepted that.
  • the imaging device outputs the access request for requesting the access to the memory connected to the data bus, and the processing for the data of the memory accessed by the bus master is stopped.
  • the access requests in the bus master among the access requests, any one of a read access request for requesting a read access for reading data from the memory and a write access request for requesting a write access for writing data to the memory
  • a read / write switching control unit for notifying of priority, a read / write switching control unit connected to the data bus, arbitrate an access request to the memory, and the read when receiving the access request to the memory output from the bus master
  • an image processing apparatus comprising a memory access device having a bus arbiter for controlling access to said memory in response to an access request received.
  • FIG. 1 is a block diagram showing a schematic configuration of an imaging device equipped with an image processing device including a memory access device according to a first embodiment of the present invention. It is the flowchart which showed the process procedure of the process which determines switching of DMA transfer in the memory access apparatus of the 1st Embodiment of this invention. It is the table which put together the state of DMA transfer in the memory access device of the 1st execution form of this invention. It is the timing chart which showed one example of the timing which does DMA transfer in the memory access device of form of 1st execution of this invention. It is the timing chart which showed an example of another timing which performs DMA transfer in the memory access device of a 1st embodiment of the present invention.
  • FIG. 1 is a block diagram showing a schematic configuration of an imaging apparatus equipped with an image processing apparatus provided with a memory access apparatus according to a first embodiment of the present invention.
  • the imaging device 1 illustrated in FIG. 1 includes an image sensor 10, an image processing device 20, a dynamic random access memory (DRAM) 30, and a display device 40.
  • DRAM dynamic random access memory
  • the image processing apparatus 20 further includes a central processing unit (CPU) 220, a bus arbiter 230, a DRAM interface unit 240, a preprocessing unit 250, an image processing unit 260, and a display processing unit 270.
  • the image processing unit 260 also includes a bus master 2601, an image processing module 2602, and a read / write switching control unit 2603.
  • the bus master 2601 further includes a read buffer 2601R and a write buffer 2601W.
  • the bus arbiter 230, the preprocessing unit 250, the image processing unit 260, and the display processing unit 270 are connected to a common data bus 210.
  • the configuration of the bus master 2601 and the read / write switching control unit 2603 provided in the image processing unit 260 in the image processing apparatus 20 and the bus arbiter 230 is the memory of the first embodiment. It corresponds to an access device.
  • the imaging device 1 captures a still image or a moving image of a subject by the image sensor 10. Then, the imaging device 1 causes the display device 40 to display a display image according to the captured still image. Further, the imaging device 1 causes the display device 40 to display a display image corresponding to the captured moving image.
  • the imaging device 1 can also record a recorded image according to a photographed still image or a moving image on a recording medium (not shown).
  • the image sensor 10 is a solid-state imaging device that photoelectrically converts an optical image of an object formed by a lens (not shown) provided in the imaging device 1.
  • the image sensor 10 is a solid-state imaging device represented by a CCD (Charge Coupled Device) image sensor or a CMOS (Complementary Metal-Oxide Semiconductor) image sensor.
  • the image sensor 10 outputs a pixel signal corresponding to the captured optical image of the subject to the preprocessing unit 250 provided in the image processing apparatus 20.
  • the DRAM 30 is a memory (data storage unit) for storing various data to be processed in the image processing apparatus 20 provided in the imaging device 1.
  • the DRAM 30 is connected to the data bus 210 via a DRAM interface unit 240 and a bus arbiter 230 provided in the image processing apparatus 20.
  • the DRAM 30 stores data of images of respective processing stages in the image processing apparatus 20.
  • the DRAM 30 stores pixel data output by the preprocessing unit 250 based on the pixel signal output from the image sensor 10.
  • the DRAM 30 stores data of images (still images, moving images, display images, recorded images, and the like) generated by the image processing unit 260 provided in the image processing apparatus 20.
  • the display device 40 is a display device that displays the display image output from the display processing unit 270 provided in the image processing device 20.
  • the display device 40 includes various display devices having different sizes of display images to be displayed, that is, different numbers of pixels.
  • a thin film transistor (TFT) liquid crystal display (LCD) that displays an image of VGA (640 ⁇ 480) size on the display device 40 or an electronic view finder (EVF)
  • TFT thin film transistor
  • LCD liquid crystal display
  • EMF electronic view finder
  • HDTV High Definition TeleVision
  • UHDTV Ultra High Definition TeleVision
  • the image processing apparatus 20 performs predetermined image processing on the pixel signal output from the image sensor 10 to generate a still image or a moving image. Further, the image processing device 20 generates a display image according to the generated still image or moving image. Then, the image processing device 20 causes the display device 40 to display the generated display image.
  • the image processing apparatus 20 can also generate a recording image according to the generated still image or moving image, and can record the generated recording image on a recording medium (not shown).
  • each of the preprocessing unit 250, the image processing unit 260, and the display processing unit 270 is a processing block that realizes the processing function of the image processing performed in the image processing apparatus 20.
  • each of the preprocessing unit 250, the image processing unit 260, and the display processing unit 270 accesses the DRAM 30 by DMA (Direct Memory Access) transfer via the data bus 210.
  • DMA Direct Memory Access
  • the CPU 220 is a control unit that controls the entire image processing apparatus 20 by controlling the respective components provided in the image processing apparatus 20.
  • the CPU 220 controls the entire image processing apparatus 20 according to a program or data for controlling each component.
  • the CPU 220 may control the components included in the imaging device 1.
  • Programs and data for controlling respective components provided in the image processing apparatus 20 by the CPU 220 are stored in the DRAM 30 connected to the data bus 210 through the DRAM interface unit 240 and the bus arbiter 230 It is also good.
  • the CPU 220 controls the entire image processing apparatus 20 by reading and executing programs and data stored in the DRAM 30 via the bus arbiter 230 and the DRAM interface unit 240.
  • the bus arbiter 230 arbitrates an access request (DMA request) to the DRAM 30 by DMA transfer from each processing block in the image processing apparatus 20 connected to the data bus 210, and transfers any one of the processing blocks to the DRAM 30. It is an arbitration circuit (so-called DMA arbitration circuit) that receives an access request.
  • the bus arbiter 230 receives an access request to the DRAM 30 from among the processing blocks that have output the access request signal (DMA request signal) based on the priorities of the processing blocks provided in the image processing apparatus 20 (see FIG. Determine the processing block to allow.
  • the bus arbiter 230 determines the read / write switching signal RW output from the image processing unit 260.
  • the access direction (writing or reading) to the DRAM 30 to be accepted (permitted) is determined. That is, the bus arbiter 230 accepts (permits) access (read access) for reading data from the DRAM 30 by the image processing unit 260 (read access) or accepts (write access) for writing data to the DRAM 30 by the image processing unit 260 (permission Is switched based on the read / write switching signal RW output from the image processing unit 260.
  • the bus arbiter 230 arbitrates the access request for notifying the access request to the processing block determined to accept (permit) the access request as a result of adjusting the access request to the DRAM 30 from each processing block It outputs a signal (a so-called DMA enable signal).
  • the bus arbiter 230 exchanges data via the data bus 210 with the processing block that has received the access request.
  • the bus arbiter 230 outputs information (access information) related to access to the DRAM 30, such as an address (including a bank) and an access direction (write or read) output together with the access request signal from the processing block that received the access request. It outputs (transfers) to the DRAM interface unit 240.
  • the bus arbiter 230 also outputs (transfers) data output from the processing block that has received the access request via the data bus 210 to the DRAM interface unit 240.
  • bus arbiter 230 receives an access request via data bus 210 for data output from DRAM interface unit 240 according to the output access information to DRAM 30. Output (transfer) to the processing block.
  • the DRAM interface unit 240 is a DRAM controller that actually exchanges data with the DRAM 30 based on the access information output from the bus arbiter 230, that is, actually transfers (DMA) data.
  • the DRAM interface unit 240 controls the DRAM 30 based on the access information to the DRAM 30 output (transferred) from the processing block to which the bus arbiter 230 has received the access request and output (transferred) from the bus arbiter 230.
  • the DRAM interface unit 240 performs a write access to the DRAM 30, the data output (transferred) from the bus arbiter 230 and the data output to the data bus 210 by the processing block for which the bus arbiter 230 receives the access request.
  • the DRAM interface unit 240 When the DRAM interface unit 240 performs read access to the DRAM 30, the DRAM interface unit 240 reads the data stored in the storage area of the address of the DRAM 30 specified by the access information, and outputs the read data to the bus arbiter 230. .
  • the preprocessing unit 250 is a processing block that performs various predetermined image processing on the data of the pixel signal output from the image sensor 10.
  • the image processing that the preprocessing unit 250 performs on the data of the pixel signal output from the image sensor 10 is, for example, so-called preprocessing such as flaw correction and shading correction.
  • the image processing (pre-processing) performed by the pre-processing unit 250 on data of pixel signals output from the image sensor 10 is not particularly limited.
  • the preprocessing unit 250 stores (writes) the data of the pixel signal (hereinafter, referred to as “preprocessed image data”) subjected to the preprocessing in the DRAM 30 by DMA transfer.
  • the pre-processing unit 250 stores an access request signal (DMA request signal) for requesting a write access to the DRAM 30 when storing (writing) the pre-processed image data in the DRAM 30, and the DRAM 30 storing the pre-processed image data.
  • An address (DMA address) for designating a storage area (including a bank) and an access direction signal (DMA write signal) indicating that it is an access direction for writing to the DRAM 30 are output to the bus arbiter 230.
  • the preprocessing unit 250 outputs the preprocessed image data to the bus arbiter 230 after the output access request signal is received by the bus arbiter 230, that is, after the access acceptance signal (DMA permission signal) is input from the bus arbiter 230. Do.
  • the preprocessed image data output from the pre-processing unit 250 is output to the DRAM 30 via the bus arbiter 230 and the DRAM interface unit 240, and is stored in the storage area of the address (DMA address) output along with the access request signal Will be written).
  • the pre-processing unit 250 may be configured to temporarily store data of pixel signals output from the image sensor 10 and then perform pre-processing. In addition, the preprocessing unit 250 may be configured to temporarily store the preprocessed image data subjected to the preprocessing and then output the data to the bus arbiter 230 in the DMA transfer.
  • the image processing unit 260 is a processing block that applies predetermined image processing to preprocessed image data stored in the DRAM 30.
  • the image processing unit 260 performs DMA transfer for acquiring (reading) preprocessed image data to be subjected to image processing, and DMA transfer for storing (writing) image data generated by performing image processing in the DRAM 30 I do. More specifically, the image processing unit 260 acquires (reads) preprocessed image data to be subjected to image processing from the DRAM 30 by DMA transfer. Then, the image processing unit 260 performs predetermined image processing on the acquired preprocessed image data. Thereafter, the image processing unit 260 stores (writes) the image data subjected to the image processing in the DRAM 30 by DMA transfer. As described above, the image processing unit 260 includes the bus master 2601, the image processing module 2602, and the read / write switching control unit 2603.
  • the image processing module 2602 is a processing module that executes predetermined image processing performed on the preprocessed image data in the image processing unit 260.
  • the image processing performed by the image processing module 2602 on the preprocessed image data includes, for example, still image compression processing such as noise removal processing, YC (brightness color difference) conversion processing, distortion correction processing, resizing processing, JPEG compression processing, etc. MPEG compression and H.264.
  • image processing for display and image processing for recording such as moving image compression processing such as H.264 compression processing.
  • the image processing module 2602 performs predetermined image processing as described above on the acquired pre-processed image data to obtain image data of a still image (hereinafter referred to as “still image data”) and image data of a moving image.
  • the image processing performed by the image processing module 2602 on the preprocessed image data is not particularly limited.
  • the image processing module 2602 performs, for example, still image expansion processing such as JPEG expansion processing, MPEG expansion processing, H.264 processing, and the like on data of a recorded image recorded on a recording medium (not shown). It may be configured to perform image processing such as moving image extension processing such as H.264 extension processing.
  • image-processed image data when the still image data and the moving image data generated by the image processing module 2602 are represented without distinction, they are referred to as “image-processed image data”.
  • the bus master 2601 is a DMA transfer unit that performs DMA transfer between the DRAM 30 and the image processing module 2602.
  • the bus master 2601 performs DMA transfer for acquiring (reading) preprocessed image data to be subjected to image processing by the image processing module 2602 from the DRAM 30, and image processed image data (still image (image) after the image processing module 2602 performs image processing DMA transfer to store (write) data and moving image data in the DRAM 30 is performed. That is, the bus master 2601 performs bidirectional (write and read) DMA transfer with the DRAM 30.
  • the bus master 2601 includes the read buffer 2601R and the write buffer 2601W.
  • Each of the read buffer 2601R and the write buffer 2601W temporarily stores (stores) image data (preprocessed image data, still image data, moving image data) of a predetermined data amount (for example, the number of pixels) It is a storage unit.
  • Each of the read buffer 2601R and the write buffer 2601W is configured of, for example, a memory such as a static random access memory (SRAM).
  • SRAM static random access memory
  • the bus master 2601 temporarily stored (saved) preprocessed image data (read) obtained (read) from the DRAM 30 by DMA transfer in the read buffer 2601R, and stored (saved) preprocessed image data of a predetermined data amount. Later, in response to a request from the image processing module 2602, the stored (stored) preprocessed image data is output to the image processing module 2602. That is, the bus master 2601 outputs the preprocessed image data acquired (read) from the DRAM 30 by DMA transfer to the image processing module 2602 in synchronization with the timing at which the image processing module 2602 performs image processing.
  • the bus master 2601 temporarily stores (saves) image processed image data (still image data and moving image data) generated by the image processing module 2602 by performing image processing in the write buffer 2601 W, and predetermined data After storing (storing) a quantity of image-processed image data, the stored (stored) image-processed image data is output to the bus arbiter 230 and stored (written) in the DRAM 30 according to the DMA transfer timing.
  • the read / write switching control unit 2603 observes the state of DMA transfer performed by the bus master 2601 and wants the bus arbiter 230 to accept (permit) an access request. To notify.
  • the read / write switching control unit 2603 requests the read access that the bus master 2601 acquires (reads) the preprocessed image data from the DRAM 30, and receives (permits) the read access request, to the read buffer 2601R.
  • the state of DMA transfer of read access by the bus master 2601 is observed by observing each of the data amounts of preprocessed image data stored (stored).
  • the image processing unit 260 shown in FIG. 1 observes the request and acceptance (permission) of read access by the bus master 2601 by the read access observation signal RA, and the preprocessed image stored in the read buffer 2601R by the read buffer observation signal RB. The amount of data is observed.
  • the read access observation signal RA is, for example, an access request signal (DMA request signal) for the bus master 2601 to request a read access, and an access acceptance signal (DMA permission signal) for the bus arbiter 230 to receive the read access request.
  • the read buffer observation signal RB is a signal indicating whether or not preprocessed image data is stored (stored) in all the storage capacities of the read buffer 2601R, and storage of more than a predetermined ratio in the read buffer 2601R. It is a signal indicating whether or not preprocessed image data is stored (stored) in the capacity.
  • the read / write switching control unit 2603 causes the bus master 2601 to store (write) the image-processed image data (still image data and moving image data) in the DRAM 30, and receives the write access request (permission).
  • the state of DMA transfer of write access by the bus master 2601 is observed by observing each of the data amount of the image processing image data stored (stored) in the write buffer 2601 W.
  • the image processing unit 260 shown in FIG. 1 observes the write access request and acceptance (permission) by the bus master 2601 by the write access observation signal WA, and the image processed image stored in the write buffer 2601 W by the light buffer observation signal WB The amount of data is observed.
  • the write access observation signal WA is, for example, an access request signal (DMA request signal) for the bus master 2601 to request a write access, and an access acceptance signal (DMA permission signal) for the bus arbiter 230 to receive the write access request.
  • the write buffer observation signal WB is a signal indicating whether or not image processing image data is stored (stored) in all the storage capacities of the write buffer 2601 W, and a storage ratio larger than a predetermined ratio in the write buffer 2601 It is a signal indicating whether or not image processing image data is stored (stored) in the capacity.
  • the read / write switching control unit 2603 performs DMA transfer of read access by the bus master 2601 (hereinafter referred to as “read DMA transfer”) and DMA transfer of write access (hereinafter, “write DMA transfer (referred to as “DMA transfer”) is determined to be prioritized. Then, the read / write switching control unit 2603 performs, based on the determined result, the DMA transfer to be prioritized, that is, the read / write switching for notifying the DMA transfer that the bus arbiter 230 wants to receive (permit) access requests Generate signal RW.
  • the parameter used by the read / write switching control unit 2603 to determine the priority DMA transfer is set by the CPU 220 in the register of the read / write switching control unit 2603.
  • the read / write switching control unit 2603 notifies the DMA transfer (read DMA transfer or write DMA transfer) that is desired to be performed preferentially by outputting the generated read / write switch signal RW to the bus arbiter 230.
  • the bus arbiter 230 uses the read / write switching signal RW to read preprocessed image data from the DRAM 30.
  • An access request for either DMA transfer acquisition (read) or DMA transfer for storing (writing) image processed image data in the DRAM 30 is accepted (permitted).
  • the display processing unit 270 acquires (reads) image-processed image data (still image data and moving image data) stored in the DRAM 30, and causes the display device 40 to display a display image according to the acquired image-processed image data. It is a block.
  • the display processing unit 270 acquires (reads out) image processed image data to be displayed on the display device 40 from the DRAM 30 by DMA transfer.
  • the display processing unit 270 obtains an access request signal (DMA request signal) for requesting a read access to the DRAM 30 when acquiring (reading out) the image processing image data from the DRAM 30, and an access processing signal of the DRAM 30 for acquiring the image processing image data.
  • An address (DMA address) for designating a storage area (including a bank) and an access direction signal (DMA read signal) indicating that it is an access direction for reading to the DRAM 30 are output to the bus arbiter 230.
  • the display processing unit 270 reads the DRAM interface unit 240 from the DRAM 30 after the output access request signal is received by the bus arbiter 230, that is, after the access acceptance signal (DMA permission signal) is input from the bus arbiter 230.
  • the image processing image data output via the bus arbiter 230 is acquired.
  • the display processing unit 270 outputs a display image corresponding to the acquired image-processed image data to the display device 40 for display.
  • the display processing unit 270 may be configured to output a display image generated by performing a predetermined display process on the image processing image data read (obtained) from the DRAM 30 and display the display image on the display device 40. Good.
  • display processing that the display processing unit 270 applies to the image-processed image data for example, processing of converting the size of the display image to the size of the image displayed by the display device 40; And processing for superimposing an on screen display (OSD) image for displaying various information related to a moving image.
  • OSD on screen display
  • the display processing performed by the display processing unit 270 on the image-processed image data is not particularly limited.
  • the display processing unit 270 may be configured to temporarily store the image-processed image data read out (obtained) from the DRAM 30 and then perform the display processing. Further, the display processing unit 270 may be configured to output data of the stored display image to the display device 40 for display after temporarily storing data of the display image subjected to the display processing.
  • the imaging device 1 captures a still image or a moving image of a subject with the image sensor 10, and causes the display device 40 to display a display image corresponding to the captured still image or the moving image.
  • the imaging device 1 can also record a recorded image according to a still image or a moving image captured by the image sensor 10 on a recording medium (not shown).
  • the memory access device of the first embodiment is configured by the bus master 2601 and the read / write switching control unit 2603 provided in the image processing unit 260 in the image processing device 20 and the bus arbiter 230.
  • the memory access apparatus of the first embodiment is configured in the image processing unit 260 which is a processing block that performs bidirectional (write and read) DMA transfer with the DRAM 30.
  • the read / write switching control unit 2603 observes the state of DMA transfer by the bus master 2601. Then, in the memory access device of the first embodiment, the read / write switching control unit 2603 reads DMA transfer (read DMA transfer) and write DMA transfer (write) based on the observed status of DMA transfer by the bus master 2601. Among the DMA transfers, the read / write switching signal RW is output to the bus arbiter 230 for notifying the DMA transfer of the one desired to be performed preferentially.
  • the bus arbiter 230 when the bus arbiter 230 receives (permits) an access request from the bus master 2601, the DMA transfer access request of the one notified by the read / write switching signal RW is obtained. Accept (permit).
  • the switching between the reading of the image data (preprocessed image data) from the DRAM 30 and the writing of the image data (image processed image data) by the bus master 2601 is appropriately performed. it can.
  • the state of the DRAM 30 is switched from the data reading state to the data writing state
  • the loss time of the predetermined time (fixed time) necessary when switching from the state where data is written to the state where data is read can not be increased more than necessary. That is, it is possible to reduce (suppress) the decrease in the transfer efficiency of the image data on the data bus 210, which may cause the system in which the memory access device of the first embodiment is mounted to be broken.
  • the image processing module 2602 that performs processing on image data transferred between the memory access device of the first embodiment and the DRAM 30 can smoothly perform a series of image processing on the image data.
  • the bus master 2601 acquires (reads out) preprocessed image data to be subjected to image processing from the DRAM 30 by DMA transfer.
  • the bus master 2601 acquires an access request signal (DMA request signal) for requesting a read access to the DRAM 30 when acquiring (reading) the preprocessed image data from the DRAM 30, and a storage area of the DRAM 30 for acquiring the preprocessing image data.
  • An address (DMA address) for designating (including a bank) and an access direction signal (DMA read signal) indicating that it is an access direction of read to the DRAM 30 are output to the bus arbiter 230.
  • the bus interface 260 reads the DRAM interface unit 240 from the DRAM 30. Are temporarily stored in the read buffer 2601R. Thereafter, the bus master 2601 stores (stores) preprocessed image data of a predetermined data amount in the read buffer 2601R, and reads out the preprocessed image data stored in the read buffer 2601R from the image processing module 2602 in response to a request. And outputs the image to the image processing module 2602.
  • the image processing module 2602 performs predetermined image processing on the preprocessed image data output from the bus master 2601 (more specifically, the read buffer 2601R), and the image processed image data (still image data (still image data) And moving image data), and outputs the generated image-processed image data to the bus master 2601.
  • the bus master 2601 temporarily stores the image processing image data output from the image processing module 2602 in the write buffer 2601W. After that, the bus master 2601 stores (saves) image processed image data of a predetermined data amount in the write buffer 2601 W, and then stores the image processed image data stored (saved) in the write buffer 2601 W in the DRAM 30 by DMA transfer. (Write).
  • the bus master 2601 stores an access request signal (DMA request signal) for requesting a write access to the DRAM 30 when storing (writing) the image processing image data in the DRAM 30, and a storage area of the DRAM 30 storing the image processing image data.
  • DMA request signal access request signal
  • An address (DMA address) for designating (including a bank) and an access direction signal (DMA write signal) indicating that it is a write access direction to the DRAM 30 are output to the bus arbiter 230.
  • the bus master 2601 receives the image processing image data stored in the write buffer 2601 W after the output access request signal is received by the bus arbiter 230, that is, after the access acceptance signal (DMA permission signal) is input from the bus arbiter 230. Read out and output to the bus arbiter 230.
  • the image processed image data (still image data and moving image data) output by the bus master 2601 is output to the DRAM 30 via the bus arbiter 230 and the DRAM interface unit 240, and the address (DMA address) It is stored (written) in a storage area.
  • the image processing unit 260 acquires (reads out) the preprocessed image data to be subjected to the image processing from the DRAM 30 and the image processed image data after the image processing is performed (still image data Image data in the DRAM 30 via the read buffer 2601 R and the write buffer 2601 W provided in the bus master 2601.
  • the image processing module 260 can perform predetermined image processing without being affected by the timing of DMA transfer with the DRAM 30.
  • the image processing performed by the image processing module 2602 on the pre-processed image data is not limited to only image processing that can perform processing on the entire area of one frame at the same time.
  • the area of one frame is divided into a plurality of rectangular blocks, and the process is sequentially performed for each of the divided blocks, and the process for all blocks is completed. Processing for the entire area is complete.
  • the read buffer 2601R and the write buffer 2601W provided in the bus master 2601 each have storage capacity capable of storing all preprocessed image data or image processed image data for one frame, the circuit size and cost will be reduced. To increase.
  • the storage capacity of the read buffer 2601R and the write buffer 2601W is generally smaller than the amount of data that can store (store) image data for one frame.
  • preprocessed image data for one frame is divided into a plurality of times and acquired (read) from the DRAM 30, and image data for one frame is divided into a plurality of times and stored in the DRAM 30 (written) There is a situation that needs to be done.
  • the bus master 2601 performs DMA transfer of read access (read It may be necessary to switch between DMA transfer) and DMA transfer of write access (write DMA transfer) multiple times.
  • DMA transfer of read access read It may be necessary to switch between DMA transfer
  • write DMA transfer write access
  • a predetermined time (certain time) is required when switching from the image data read state to the image data write state or the reverse state.
  • the predetermined time (fixed time) is a loss time of transfer of the image data in the DRAM 30, and causes a decrease in transfer efficiency of the image data via the data bus 210 between the image processing unit 260 and the DRAM 30. Therefore, if the image processing unit 260 does not switch the state of the DRAM 30 which requires a predetermined time (a fixed time) as much as possible, it is possible to reduce the loss time which causes the system to break down.
  • the state of the DRAM 30 is permitted after allowing generation of loss time. Sometimes you have to switch. However, even in this case, it is preferable that switching of the state of the DRAM 30 be as small as possible.
  • the read / write switching control unit 2603 observes the state of DMA transfer performed by the bus master 2601 and switches between the read DMA transfer and the write DMA transfer appropriately in the bus master 2601. Control. At this time, the read / write switching control unit 2603 determines which of DMA transfer of read DMA transfer and write DMA transfer is to be prioritized based on the observed state of DMA transfer. This determination is performed by determining the degree of margin in the read DMA transfer and the write DMA transfer performed by the bus master 2601 and the degree of congestion of the data bus 210.
  • the read / write switching control unit 2603 determines whether the read DMA transfer for the bus master 2601 to output the preprocessed image data to be subjected to the image processing by the image processing module 2602 is smoothly performed or the image processing module 2602 Whether write DMA transfer for causing the DRAM 30 to store (write) image-processed image data generated by performing image processing is performed smoothly is determined according to the observed DMA transfer state. In other words, the read / write switching control unit 2603 performs DMA transfer that observes whether or not a state where image processing to be executed by the image processing module 2602 is waiting has occurred, that is, whether image processing has stopped.
  • the read / write switching control unit 2603 determines whether the amount of data (including image data generated by other processing blocks) being delivered via the data bus 210 is larger than a predetermined amount of data. In other words, it is determined by the state of the observed DMA transfer that how much data is currently being transferred via the data bus 210.
  • FIG. 2 is a flow chart showing a processing procedure of processing for determining switching of DMA transfer in the memory access apparatus of the first embodiment of the present invention.
  • the read / write switching control unit 2603 requests the read access in the read DMA transfer and the data amount of preprocessed image data stored (saved) in the read buffer 2601 R and the request for the write access in the write DMA transfer. And each of the data amount of the image processing image data stored (stored) in the write buffer 2601 W is observed as the state of DMA transfer performed by the bus master 2601. Then, the read / write switching control unit 2603 first determines whether or not a state in which image processing to be executed by the image processing module 2602 is waiting has occurred based on the observed state of DMA transfer (step S110). ).
  • step S110 When it is determined in step S110 that no waiting state has occurred in the image processing performed by the image processing module 2602 (“NO” in step S110), the read / write switching control unit 2603 proceeds to step S130.
  • step S110 when it is determined in step S110 that a waiting state is occurring in the image processing performed by the image processing module 2602 ("YES" in step S110), the read / write switching control unit 2603 determines the congestion degree of the data bus 210. However, it is determined whether it is larger than a predetermined congestion degree (step S120).
  • step S120 the congestion degree of the data bus 210 is not larger than the predetermined congestion degree, that is, the data amount of data being delivered via the data bus 210 represents the predetermined data amount represented by the congestion degree If it is determined that the read data is less than ("NO" in step S120), the read / write switching control unit 2603 proceeds to step S130.
  • step S120 the degree of congestion of data bus 210 is larger than the predetermined degree of congestion, that is, the data amount indicated by the degree of congestion indicates the amount of data being delivered via data bus 210. If it is determined that the amount is larger than the amount ("YES" in step S120), the read / write switching control unit 2603 proceeds to step S140.
  • step S110 When the read / write switching control unit 2603 determines in step S110 that no waiting state occurs in the image processing performed by the image processing module 2602 (“NO” in step S110), or the congestion of the data bus 210 in step S120 If it is determined that the degree is not larger than the predetermined degree of congestion ("NO” in step S120), a first switching threshold is generated (step S130).
  • the read / write switching control unit 2603 generates a second switching threshold when it is determined in step S120 that the congestion degree of the data bus 210 is larger than the predetermined congestion degree (“YES” in step S120). (Step S140).
  • the read / write switching control unit 2603 By such processing, the read / write switching control unit 2603 generates a first switching threshold or a second switching threshold. Then, the read / write switching control unit 2603 causes the data amount of preprocessed image data stored (stored) in the read buffer 2601R and the data amount of image processed image data stored (stored) in the write buffer 2601W. The determination is made using either the generated first switching threshold or the second switching threshold. The read / write switching control unit 2603 determines, based on the determination result, DMA transfer to be performed preferentially. That is, the read / write switching control unit 2603 prioritizes read DMA transfer or prioritizes write DMA transfer using either the first switching threshold or the second switching threshold. Decide.
  • the read / write switching control unit 2603 generates a read / write switching signal RW for notifying switching to the determined DMA transfer, and outputs the read / write switching signal RW to the bus arbiter 230. Accordingly, when the bus arbiter 230 determines the image processing unit 260 as a processing block that accepts (permits) an access request to the DRAM 30, the image processing unit 260 (more specifically, the read / write switching control unit 2603) Receive (permit) the access request for the DMA transfer of the one notified by the read / write switching signal RW outputted from the device.
  • the read / write switching control unit 2603 generates only one of the first switching threshold and the second switching threshold, and stores (saves) the read buffer 2601R using only the generated switching threshold
  • the amount of preprocessed image data and the amount of image processed image data stored (stored) in the write buffer 2601 W may be determined. That is, the read / write switching control unit 2603 always gives priority to read DMA transfer using only one of the generated first switching threshold and second switching threshold, or the write DMA transfer. It may be configured to determine whether to prioritize.
  • FIG. 3 is a table summarizing the state of DMA transfer in the memory access apparatus of the first embodiment of the present invention.
  • FIG. 3 shows an example of the DMA transfer state in the bus master 2601 observed by the read / write switching control unit 2603.
  • image processing image data (still image data and moving image data) having a data amount sufficient for the read / write switching control unit 2603 to store (write) in the DRAM 30 by write DMA transfer is stored (saved) in the write buffer 2601W. If it can not be observed, the item of "write buffer” becomes "empty".
  • the read / write switching control unit 2603 observes each item of “read buffer”, “write buffer”, “read access request”, and “write access request” in the table of FIG. Based on the state of DMA transfer in the bus master 2601, the process of step S110 is performed to determine whether the image processing to be executed by the image processing module 2602 is in a waiting state.
  • the observed DMA transfer status outputs an access request for read DMA transfer, and each of the read buffer 2601R and the write buffer 2601W is “empty”.
  • the read / write switching control unit 2603 determines that the bus master 2601 is waiting to receive (permit) an access request for read DMA transfer. In this case, when the image processing module 2602 waits for the preprocessed image data necessary for performing the image processing to be aligned with the read buffer 2601R, the read / write switching control unit 2603 stops the image processing. judge.
  • the read / write switching control unit 2603 determines that the bus master 2601 is in a state of waiting for acceptance (permission) of an access request for write DMA transfer. In this case, the read / write switching control unit 2603 performs image processing while waiting for the image processing module 2602 to be able to output image processed image data after image processing to the write buffer 2601 W. Is determined to have stopped.
  • one of the read buffer 2601R and the write buffer 2601W is "empty” and the other is "full” as shown in the second or third stage of FIG. If there is, the read / write switching control unit 2603 determines that the image processing module 2602 is in the normal operation state. That is, the read / write switching control unit 2603 determines that the image processing module 2602 is not in the state of waiting for the execution of the image processing (the image processing is not stopped in the waiting state).
  • the read / write switching control unit 2603 receives a request for read access in read DMA transfer performed by the bus master 2601 and a request (acceptance) for a request for read access, a request for write access in write DMA transfer, and a write access Each of the request acceptance (permission) is observed as the state of DMA transfer performed by the bus master 2601.
  • the read / write switching control unit 2603 performs data processing based on the time from when the bus master 2601 outputs the DMA transfer access request to the bus arbiter 230 until the output access request is accepted (permitted) by the bus arbiter 230.
  • a process of step S120 is performed to determine whether the degree of congestion of the bus 210 is larger than a predetermined degree of congestion.
  • the read / write switching control unit 2603 sets, in advance, the time from when the observed bus master 2601 outputs an access request to when the output access request is accepted (permitted) by the bus arbiter 230.
  • the time of access acceptance interval for determining the degree of congestion (hereinafter referred to as “access acceptance interval time for congestion determination”) is compared. That is, the read / write switching control unit 2603 calculates the difference between the time when the bus master 2601 outputs the access request and the time when the output access request is accepted (permitted) by the bus arbiter 230, and the calculated difference And the access time interval for congestion judgment.
  • the congestion determination access acceptance interval time compared by the read / write switching control unit 2603 in step S120 is, for example, the number of processing blocks sharing the DRAM 30 via the data bus 210, specifications of data input / output in the DRAM 30, Is a predetermined time parameter based on.
  • the congestion determination access acceptance interval time is a parameter of the time from when the CPU 220 outputs an access request to the bus arbiter 230 by the CPU 2201 and when the output access request is accepted (permitted) by the bus arbiter 230.
  • the register of the read / write switching control unit 2603 is preset.
  • the read / write switching control unit 2603 sets a difference time from the time when the observed bus master 2601 outputs the access request to the time when the access request is accepted (permitted) within the set congestion judgment access acceptance interval time. If it is, it is determined that the congestion degree of the data bus 210 is not larger than the predetermined congestion degree. On the other hand, the read / write switching control unit 2603 is configured to use the congestion determination access acceptance interval for the difference time from the time when the observed bus master 2601 outputs the access request to the time when the access request is accepted (permitted) If it is longer than the time, it is determined that the congestion degree of the data bus 210 is larger than the predetermined congestion degree.
  • the read / write switching control unit 2603 performs the process of generating the first switching threshold in step S130 or the generation of the second switching threshold in step S140 based on the results of the determination in step S110 and step S120. Do the processing.
  • the process of generating the first switching threshold in step S130 and the switching threshold generated in the process of generating the second switching threshold in step S140 will be described.
  • the first switching threshold is data that can be DMA transferred to the write buffer 2601 W when preprocessed image data of a data amount that can be output to the image processing module 2602 is stored in the read buffer 2601 R It is a switching threshold value for switching DMA transfer that is desired to be performed preferentially based on the amount of image-processed image data being stored (stored). Therefore, the first switching threshold is a first switching threshold corresponding to the read buffer 2601R (hereinafter referred to as "first read switching threshold”), and a first switching threshold corresponding to the write buffer 2601W (hereinafter referred to as "first And the light switching threshold value of 1.).
  • the read / write switching control unit 2603 calculates the first read switching threshold according to the following equation (1). In addition, the read / write switching control unit 2603 calculates the first write switching threshold value by the following equation (2).
  • First read switching threshold image processing startable data amount + WR switching loss time processing amount (1)
  • First write switching threshold DMA transfer startable data amount-RW switching loss time processing amount ...
  • the image processing startable data amount is the data amount (for example, the number of pixels) of preprocessed image data that can be read by the image processing module 2602 from the read buffer 2601R and start image processing.
  • the WR switching loss time processing amount is between the predetermined (fixed) time loss time necessary for switching the state of the DRAM 30 from the state where data is written to the state where data is read. The amount of data (for example, the number of pixels) of preprocessed image data which can be read out from the read buffer 2601R and subjected to image processing by the image processing module 2602.
  • the image processing startable data amount and the WR switching loss time processing amount for the read / write switching control unit 2603 to calculate the first read switching threshold are used as parameters for calculating the first read switching threshold. It is set by the CPU 220 in the register of the read / write switching control unit 2603.
  • the DMA transfer startable data amount is the data amount (for example, the number of pixels) of the image processed image data which the bus master 2601 can read from the write buffer 2601W and start the write DMA transfer.
  • the RW switching loss time processing amount is between the predetermined (fixed) time loss time necessary for switching the state of the DRAM 30 from the data reading state to the data writing state The amount of data (for example, the number of pixels) of image-processed image data that the image processing module 2602 can perform image processing and store (save) in the light buffer 2601W.
  • the DMA transfer startable data amount and the RW switching loss time processing amount for the read / write switching control unit 2603 to calculate the first write switching threshold are parameters for calculating the first write switching threshold. It is set by the CPU 220 in the register of the read / write switching control unit 2603.
  • the read / write switching control unit 2603 can perform image processing and DMA transfer during a predetermined (fixed) time loss time necessary for switching the state of the DRAM 30. Generate a first switching threshold that takes volume into account. Then, the read / write switching control unit 2603 causes the data amount of preprocessed image data stored (stored) in the read buffer 2601R and the data amount of image processed image data stored (stored) in the write buffer 2601W. The determination is made based on the first read switching threshold value and the first write switching threshold value, and a read write switching signal RW for switching DMA transfer to be performed preferentially is generated and output to the bus arbiter 230.
  • the read / write switching control unit 2603 performs read DMA transfer when the data amount of preprocessed image data stored (stored) in the read buffer 2601R reaches the first read switching threshold value.
  • a read / write switching signal RW notifying that priority is given is output to the bus arbiter 230. That is, when the data amount of preprocessed image data stored (stored) in the read buffer 2601 R becomes equal to or less than the first read switching threshold, the read / write switching control unit 2603 gives priority to the read DMA transfer. Is output to the bus arbiter 230.
  • the read / write switching control unit 2603 gives priority to write DMA transfer when the data amount of the image processing image data stored (stored) in the write buffer 2601 W reaches the first write switching threshold.
  • the read / write switching signal RW to be notified is output to the bus arbiter 230. That is, the read / write switching control unit 2603 gives priority to the write DMA transfer when the data amount of the image processing image data stored (stored) in the write buffer 2601 W becomes equal to or more than the first write switching threshold. Is output to the bus arbiter 230.
  • the second switching threshold may be image processed image data that can be stored (stored) in the write buffer 2601 W when all preprocessed image data stored (stored) in the read buffer 2601 R is output to the image processing module 2602. It is a switching threshold value for switching the DMA transfer which is desired to be performed preferentially on the basis of the time when L disappears. That is, the second switching threshold is a switching threshold based on when all of the storage capacities of the read buffer 2601R are free and when the storage capacity of the write buffer 2601W is full.
  • the second switching threshold also corresponds to the second switching threshold corresponding to the read buffer 2601R (hereinafter referred to as “second read switching threshold”) and the write buffer 2601W, similarly to the first switching threshold.
  • second read switching threshold corresponding to the read buffer 2601R
  • write buffer 2601W similarly to the first switching threshold.
  • a second switching threshold (hereinafter referred to as “second light switching threshold”) is configured.
  • the read / write switching control unit 2603 calculates the second read switching threshold according to the following equation (3). Further, the read / write switching control unit 2603 calculates the second write switching threshold according to the following equation (4).
  • Second read switching threshold WR switching loss time processing amount + amount of data that can be processed during DMA transfer (3)
  • Second light switching threshold storage capacity-RW switching loss time processing amount (4)
  • the WR switching loss time throughput is the same as the WR switching loss time throughput for calculating the first read switching threshold in the above equation (1).
  • the bus master 2601 acquires (reads out) preprocessed image data from the DRAM 30 by read DMA transfer during DMA transfer, and stores it in all storage capacities of the read buffer 2601R ( It is a data amount (for example, the number of pixels) of preprocessed image data which can be read out from the read buffer 2601R and processed by the image processing module 2602 until storage.
  • the WR switching loss time processing amount for the read / write switching control unit 2603 to calculate the second read switching threshold and the amount of processable data during DMA transfer are parameters for calculating the second read switching threshold.
  • the read / write switching control unit 2603 is set by the CPU 220 in the register.
  • the storage capacity is the storage capacity of the write buffer 2601 W, that is, the data amount (for example, the number of pixels) of image processed image data that can be stored (saved) in the write buffer 2601 W.
  • the RW switching loss time throughput is the same as the RW switching loss time throughput for calculating the first light switching threshold in the above equation (2).
  • the storage capacity for the read / write switching control unit 2603 to calculate the second write switching threshold and the RW switching loss time processing amount are read by the CPU 220 as parameters for calculating the second write switching threshold. It is set in the register of the write switching control unit 2603.
  • the read / write switching control unit 2603 generates a second switching threshold in consideration of the storage capacity of the read buffer 2601R and the write buffer 2601W in the process of step S140. Then, the read / write switching control unit 2603 stores the data amount of preprocessed image data stored (stored) in the read buffer 2601 R and the data stored in the write buffer 2601 W as in the case of using the first switching threshold. And the data amount of the image-processed image data being processed) based on the second read switching threshold value and the second write switching threshold value, and generates the read / write switching signal RW and outputs it to the bus arbiter 230.
  • the read / write switching control unit 2603 is configured to use the second data amount of preprocessed image data stored (stored) in the read buffer 2601R.
  • a read / write switching signal RW is output to the bus arbiter 230 to notify that priority is given to read DMA transfer. That is, as in the case of using the first switching threshold value, the read / write switching control unit 2603 reduces the data amount of preprocessed image data stored (stored) in the read buffer 2601R to less than or equal to the second read switching threshold value.
  • the read / write switching signal RW notifying that priority is given to the read DMA transfer is output to the bus arbiter 230.
  • the read / write switching control unit 2603 sets the data amount of the image processing image data stored (stored) in the write buffer 2601 W as the second write switching threshold, as in the case of using the first switching threshold.
  • it arrives, it outputs to the bus arbiter 230 a read / write switching signal RW notifying that priority is given to write DMA transfer. That is, as in the case of using the first switching threshold, the read / write switching controller 2603 determines that the data amount of the image processing image data stored (stored) in the write buffer 2601 W is equal to or greater than the second write switching threshold.
  • the read / write switching signal RW notifying that priority is given to the write DMA transfer is output to the bus arbiter 230.
  • the priority of the image processing unit 260 is higher than that of the preprocessing unit 250 and the display processing unit 270. Not high. That is, even when the image processing unit 260 outputs an access request to the DRAM 30, the bus arbiter 230 outputs the access request to the DRAM 30 when the preprocessing unit 250 and the display processing unit 270 also output an access request to the DRAM 30.
  • the access request from the display processing unit 270 is accepted (permitted).
  • FIG. 4 is a timing chart showing an example of the timing for performing DMA transfer in the memory access apparatus of the first embodiment of the present invention.
  • FIG. 4 shows an example of the timing of the operation of switching the DMA transfer at the transition of the amount of data stored (stored) in each of the read buffer 2601R and the write buffer 2601W provided in the bus master 2601.
  • each of the read buffer 2601R and the write buffer 2601W has two sets of storage capacities for storing image data (preprocessed image data or image processed image data) of a predetermined data amount. It shows the transition of the amount of data in the case of a so-called double buffer configuration. That is, in FIG. 4, each of the read buffer 2601R and the write buffer 2601W alternately switches between writing of image data to one storage capacity set and reading of image data from the other storage capacity set.
  • each of the read buffer 2601R and the write buffer 2601W of the double buffer configuration can be easily considered based on the technology for controlling the operation of the existing double buffer. Therefore, detailed description of the operation of each of the read buffer 2601R and the write buffer 2601W of the double buffer configuration is omitted.
  • FIG. 4 shows an example of respective timings of a read / write switching signal RW outputted to the bus arbiter 230 by the read / write switching control unit 2603 and DMA transfer accepted (permitted) by the bus arbiter 230.
  • the read / write switching signal RW output from the read / write switching control unit 2603 indicates that priority is given to read DMA transfer at the “High” level, and priority is given to write DMA transfer at the “Low” level.
  • “R” shown at the timing of DMA transfer represents a read DMA transfer
  • “W” represents a write DMA transfer.
  • the bus master 2601 When the image processing unit 260 starts image processing on the preprocessed image data, the bus master 2601 first acquires (reads out) preprocessed image data to be subjected to image processing from the DRAM 30 by read DMA transfer. Therefore, the read / write switching control unit 2603 outputs, to the bus arbiter 230, a “high” level read / write switching signal RW notifying that priority is given to the read DMA transfer. Thereby, the bus arbiter 230 accepts (permits) the access request for the read DMA transfer output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) the access request to the DRAM 30. Preprocessed image data acquired (read) from the DRAM 30 is sequentially stored (saved) in the read buffer 2601R.
  • the image processing module 2602 When the data amount of the preprocessed image data stored (stored) in the read buffer 2601R becomes equal to or larger than the image processing startable data amount, the image processing module 2602 performs the preprocessed image stored (stored) in the read buffer 2601R. Data can be read out and image processing can be performed. At this time, the bus master 2601 outputs the preprocessed image data stored (saved) in the read buffer 2601R to the image processing module 2602 at the timing when the image processing module 2602 performs image processing. As a result, the data amount of the preprocessed image data stored (stored) in the read buffer 2601 R decreases by the amount output to the image processing module 2602.
  • the image processing module 2602 outputs to the bus master 2601 the image processed image data generated by performing image processing on the preprocessed image data output from the bus master 2601 and stores (saves) in the write buffer 2601 W. .
  • the image processing image data output from the image processing module 2602 is sequentially stored (saved) in the write buffer 2601W from timing t1, and the data amount of the image processing image data in the write buffer 2601W Will increase.
  • the read / write switching control unit 2603 performs read / write switching at timing t2 when the data amount of the image processing image data stored (stored) in the observed write buffer 2601W becomes equal to or more than the first write switching threshold.
  • the signal RW is brought to "Low" level to notify that priority is given to the write DMA transfer.
  • the bus arbiter 230 accepts (permits) the write DMA transfer access request output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) the access request to the DRAM 30.
  • the state of the DRAM 30 is switched from the state of reading data to the state of writing data.
  • the bus master 2601 receives the image-processed image data stored (saved) in the write buffer 2601 W by the write DMA transfer from the timing t3 at which the predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed.
  • the read / write switching control unit 2603 causes the data amount of the image processing image data stored (stored) in the write buffer 2601 W to reach the DMA transfer startable data amount based on the first write switching threshold value.
  • the read / write switching signal RW is changed.
  • the image processing module 2602 performs image processing by reading preprocessed image data stored (stored) in the read buffer 2601R also after timing t2. Therefore, the image stored (saved) in the write buffer 2601 W by the time the bus master 2601 starts write DMA transfer, that is, a loss time of a predetermined time (fixed time) required for switching in the DRAM 30 elapses.
  • the data amount of the processing image data is the DMA transfer startable data amount.
  • the bus master 2601 can start the write DMA transfer from timing t3 without waiting for the image processing image data to be stored (saved) until the storage capacity of the write buffer 2601W becomes full. As a result, the data amount of the image-processed image data stored (stored) in the write buffer 2601 W decreases by the amount stored (written) in the DRAM 30.
  • the image processing module 2602 performs image processing by reading preprocessed image data stored (stored) in the read buffer 2601R also after timing t3. Therefore, as in the example of the timing chart shown in FIG. 4, the data amount of the image processing image data stored (saved) in the write buffer 2601 W increases by the end of the image processing by the image processing module 2602. .
  • the data amount of the image-processed image data stored (stored) in the write buffer 2601W observed by the read / write switching control unit 2603 becomes equal to or more than the first write switching threshold again.
  • the data amount of preprocessed image data stored (saved) in the read buffer 2601R observed by the read / write switching control unit 2603 at the timing t4 is the first. Is below the lead switching threshold of. Therefore, the read / write switching control unit 2603 can change the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer.
  • the read / write switching control unit 2603 determines DMA transfer to be prioritized based on the priority between the read DMA transfer performed by the bus master 2601 and the write DMA transfer determined in advance by the image processing unit 260. .
  • the read DMA transfer performed by the bus master 2601 has higher priority than the write DMA transfer. Therefore, in the example of the timing chart shown in FIG. 4, at timing t4, the read / write switching control unit 2603 sets the read / write switching signal RW to the “High” level notifying that priority is given to the read DMA transfer. ing.
  • the bus arbiter 230 accepts (permits) the access request for the read DMA transfer output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) the access request to the DRAM 30.
  • the state of the DRAM 30 is switched from the state where data is written to the state where data is read.
  • the bus master 2601 acquires (reads) preprocessed image data from the DRAM 30 by read DMA transfer from timing t5 at which a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed, and reads buffer 2601R. Store (save).
  • the read / write switching control unit 2603 causes the pre-processed image data stored (stored) in the read buffer 2601 R to decrease before the image processing startable data amount based on the first read switching threshold At time t4, the read / write switching signal RW is changed.
  • preprocessed image data acquired (read) from the DRAM 30 is sequentially stored (saved) in the read buffer 2601R from timing t5.
  • the amount of processed image data increases.
  • the image processing module 2602 can continue the image processing on the preprocessed image data without waiting for the preprocessed image data necessary for the read buffer 2601R to be stored (saved).
  • the method of determining which of DMA transfer of read DMA transfer and write DMA transfer is to be prioritized is limited to the method based on the priority determined in advance by the image processing unit 260 as described above. Absent. For example, the read / write switching control unit 2603 prioritizes the DMA transfer based on the observed DMA transfer state so that the image processing performed by the image processing module 2602 is not kept waiting and does not occur. You may decide More specifically, as described above, the state in which the image processing is kept waiting is the state in which the image processing module 2602 waits for the preprocessed image data necessary for performing the image processing to be aligned with the read buffer 2601R.
  • the read / write switching control unit 2603 causes the data amount of preprocessed image data stored (stored) in the observed read buffer 2601R and the data amount of image processed image data stored (stored) in the write buffer 2601W.
  • the DMA transfer to be preferentially performed may be determined based on the above so as to eliminate the cause of the earlier arrival of the state. In the example of the timing chart shown in FIG.
  • the image processing module 2602 reads out preprocessed image data stored (saved) in the read buffer 2601R and performs image processing until the storage capacity of the write buffer 2601W becomes full.
  • the time required for the bus master 2601 to acquire (read) the preprocessed image data from the DRAM 30 by read DMA transfer is shorter than the time required to store (store) the processed image data. For this reason, image processing image data after the image processing module 2602 performs image processing is better when waiting for the image processing module 2602 to have preprocessed image data necessary for performing image processing aligned in the read buffer 2601R. Is sent earlier than the state waiting for it to be able to be output to the write buffer 2601W. From this, the read / write switching control unit 2603 determines the read DMA transfer, which completes earlier, as the DMA transfer to be performed preferentially.
  • the read / write switching control unit 2603 When read DMA transfer is started from timing t5, the read / write switching control unit 2603 performs image processing stored (saved) in the write buffer 2601W that has reached the first write switching threshold again at timing t4. In response to the data amount of the image data, the read / write switching signal RW is set to the “Low” level to notify that the write DMA transfer is prioritized. Thereby, the bus arbiter 230 accepts (permits) the write DMA transfer access request output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) the access request to the DRAM 30. The state of the DRAM 30 is switched from the state of reading data to the state of writing data. In the example of the timing chart shown in FIG.
  • the bus master 2601 can start the write DMA transfer from timing t7 when a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed.
  • the read / write switching control unit 2603 performs read / write at timing t8 when the data amount of the image-processed image data stored (stored) in the observed write buffer 2601W becomes equal to or more than the first write switching threshold again.
  • the switching signal RW is set to the “Low” level to notify that the write DMA transfer is prioritized.
  • the read / write switching signal RW is at the “Low” level from the timing before the timing t8. That is, the state of the DRAM 30 is a state in which data is already written. Therefore, the bus master 2601 can immediately start the write DMA transfer from the timing t9 when the image processing image data is stored (saved) in the write buffer 2601W to the DMA transfer startable data amount.
  • the read / write switching control unit 2603 performs data processing of preprocessed image data stored (stored) in the observed read buffer 2601R and image processing stored (stored) in the observed write buffer 2601W.
  • the read / write switching signal RW is changed based on the data amount of the image data. More specifically, the read / write switching control unit 2603 performs read / write switching when the data amount of preprocessed image data stored (stored) in the observed read buffer 2601 R becomes equal to or less than the first read switching threshold.
  • the signal RW is brought to "High" level to notify that read DMA transfer is to be prioritized.
  • the read / write switching control unit 2603 outputs Set to “Low” level to notify that priority is given to write DMA transfer.
  • the read / write switching control unit 2603 sets the read / write switching signal RW to the “High” level and performs read DMA transfer between timing t11 and timing t13. It shows the timing. Further, in the example of the timing chart shown in FIG. 4, at timing t12, the read / write switching control unit 2603 sets the read / write switching signal RW to "Low” level and performs write DMA transfer from timing t14 to timing t15. The timing at which the write DMA transfer is performed immediately after the timing t16 is shown according to the "Low" level of the read / write switching signal RW at the time of.
  • the read / write switching control unit 2603 sets the read / write switching signal RW to the “High” level to perform read DMA transfer between timing t18 and timing t20. Shows the timing of doing Further, in the example of the timing chart shown in FIG. 4, at timing t19, the read / write switching control unit 2603 sets the read / write switching signal RW to the “Low” level and performs write DMA transfer from timing t21 to timing t22. The timing at which the write DMA transfer is performed immediately after the timing t23 is shown according to the "Low" level of the read / write switching signal RW at the time of.
  • the read / write switching control unit 2603 sets the read / write switching signal RW to the “High” level to perform read DMA transfer between timing t25 and timing t27. Shows the timing of doing Further, in the example of the timing chart shown in FIG. 4, at timing t26, the timing at which the read / write switching control unit 2603 sets the read / write switching signal RW to the “Low” level and notifies that priority is given to write DMA transfer. Is shown.
  • FIG. 5 is a timing chart showing an example of another timing for performing DMA transfer in the memory access device according to the first embodiment of the present invention.
  • the read buffer 2601R and the write buffer 2601W provided in the bus master 2601 are stored in each of the read buffer 2601W, as in the example of the timing chart of the operation of switching DMA transfer based on the first switching threshold shown in FIG. An example of the timing of the operation of switching the DMA transfer in accordance with the transition of the data amount stored) is shown. Also in FIG. 5, similarly to the example of the timing chart shown in FIG. 4, the transition of the data amount in the case where each of the read buffer 2601R and the write buffer 2601W has a double buffer configuration is shown.
  • FIG. 5 similarly to the example of the timing chart shown in FIG. 4, the read / write switching signal RW output to the bus arbiter 230 by the read / write switching control unit 2603 and DMA accepted (permitted) by the bus arbiter 230.
  • An example of each timing with transfer is shown. Also in FIG. 5, the level represented by the read / write switching signal RW and the timing of DMA transfer are the same as in the example of the timing chart shown in FIG.
  • the bus master 2601 When the image processing unit 260 starts image processing for preprocessed image data, the bus master 2601 first performs preprocessed image data to be subjected to image processing by read DMA transfer, as in the example of the timing chart shown in FIG. 4. Acquire (read) from the DRAM 30. Therefore, the read / write switching control unit 2603 outputs, to the bus arbiter 230, a “high” level read / write switching signal RW notifying that priority is given to the read DMA transfer. As a result, as in the example of the timing chart shown in FIG. 4, preprocessed image data acquired (read) from the DRAM 30 is sequentially stored (stored) in the read buffer 2601R.
  • the image processing module 2602 when the data amount of the preprocessed image data stored (stored) in the read buffer 2601 R becomes equal to or more than the image processing startable data amount, the image processing module 2602, as in the example of the timing chart shown in FIG.
  • the preprocessed image data stored (saved) in the read buffer 2601 R can be read out to perform image processing.
  • the image processing module 2602 performs image processing on the preprocessed image data output from the bus master 2601 as in the example of the timing chart shown in FIG. , And stored (saved) in the write buffer 2601W.
  • the example of the timing chart shown in FIG. 5 similarly to the example of the timing chart shown in FIG.
  • the image processing image data output from the image processing module 2602 is sequentially stored (saved) in the write buffer 2601W from timing t1.
  • the data amount of the image processing image data in the write buffer 2601 W is increased.
  • the data amount of the preprocessed image data stored (stored) in the read buffer 2601 R also decreases by the amount output to the image processing module 2602 as in the example of the timing chart shown in FIG. 4.
  • the read / write switching control unit 2603 performs read / write switching at timing t2 when the data amount of the image-processed image data stored (stored) in the observed write buffer 2601W becomes equal to or greater than the second write switching threshold.
  • the signal RW is brought to "Low" level to notify that priority is given to the write DMA transfer.
  • the bus arbiter 230 outputs the output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) an access request to the DRAM 30, as in the example of the timing chart shown in FIG. An access request for write DMA transfer is accepted (permitted), and the state of the DRAM 30 is switched from the state in which data is read to the state in which data is written.
  • the bus master 2601 performs write DMA transfer by write DMA transfer from timing t3 at which a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed.
  • the image processing image data stored (saved) is stored (written) in the DRAM 30.
  • the read / write switching control unit 2603 determines that the data amount of the image processing image data stored (stored) in the write buffer 2601 W is full based on the second write switching threshold, that is, the write buffer 2601 W
  • the read / write switching signal RW is changed at timing t2 before the storage capacity is full.
  • the image processing module 2602 performs image processing by reading preprocessed image data stored (saved) in the read buffer 2601R also after timing t2, as in the example of the timing chart shown in FIG.
  • the image stored (saved) in the write buffer 2601 W by the time the bus master 2601 starts write DMA transfer that is, a loss time of a predetermined time (fixed time) required for switching in the DRAM 30 elapses.
  • the data amount of processed image data is full.
  • the bus master 2601 can start the write DMA transfer from timing t3 without waiting for the image processing image data to be stored (saved) until the storage capacity of the write buffer 2601W becomes full.
  • the data amount of the image-processed image data stored (stored) in the write buffer 2601 W decreases by the amount stored (written) in the DRAM 30. To go.
  • the image processing module 2602 performs image processing by reading preprocessed image data stored (saved) in the read buffer 2601R after timing t3 as in the example of the timing chart shown in FIG. Therefore, as in the example of the timing chart shown in FIG. 5, the data amount of the image processing image data stored (stored) in the write buffer 2601 W increases by the amount of completion of the image processing by the image processing module 2602. .
  • the read / write switching control unit 2603 performs the read / write switching.
  • the signal RW is brought to "High" level to notify that read DMA transfer is to be prioritized.
  • the bus arbiter 230 accepts (permits) the access request for the read DMA transfer output from the bus master 2601 when determining the image processing unit 260 as a processing block for accepting (permitting) the access request to the DRAM 30.
  • the state of the DRAM 30 is switched from the state where data is written to the state where data is read.
  • the bus master 2601 acquires (reads) preprocessed image data from the DRAM 30 by read DMA transfer from timing t5 at which a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed, and reads buffer 2601R. Store (save).
  • the read / write switching control unit 2603 determines that the preprocessed image data stored (saved) in the read buffer 2601R is empty based on the second read switching threshold, that is, the storage capacity of the read buffer 2601R is The read / write switching signal RW is changed at timing t4 before the state is all vacant.
  • preprocessed image data acquired (read) from the DRAM 30 is sequentially stored (saved) in the read buffer 2601R from timing t5.
  • the amount of processed image data increases.
  • the image processing module 2602 can continue the image processing on the preprocessed image data without waiting for the preprocessed image data necessary for the read buffer 2601R to be stored (saved).
  • the read / write switching control unit 2603 performs read / write switching at timing t6 when the data amount of the image-processed image data stored (stored) in the observed write buffer 2601W becomes equal to or greater than the second write switching threshold.
  • the signal RW is brought to "Low" level to notify that priority is given to the write DMA transfer.
  • the bus DMA 230 is in the middle of performing a read DMA transfer (allowed) accepted earlier.
  • the timing at which the bus arbiter 230 determines the image processing unit 260 as a processing block that accepts (permits) the access request to the DRAM 30 is, as early as after the timing t7 at which the read DMA transfer ends. That is, the timing when the bus master 2601 can start the next DMA transfer is after timing t7.
  • the access request accepted (permitted) by the bus arbiter 230 is an access request for write DMA transfer. Therefore, when the bus arbiter 230 receives (permits) the access request for write DMA transfer output from the bus master 2601, the bus arbiter 230 switches the state of the DRAM 30 from the state of reading data to the state of writing data.
  • the bus master 2601 starts write DMA transfer from timing t8 when a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed. Therefore, the image processing module 2602 waits for image processing to be performed from timing t7 when read DMA transfer ends to timing t8 when a predetermined (constant) loss time necessary for switching the state of the DRAM 30 elapses. It is in the state of
  • the read / write switching control unit 2603 performs read / write
  • the switching signal RW is set to the “Low” level to notify that the write DMA transfer is prioritized.
  • the read / write switching signal RW is at the “Low” level from the timing before timing t9.
  • the state is a state in which data is already written. Therefore, the bus master 2601 can immediately start the write DMA transfer from timing t10 at which the image processed image data is stored (saved) until the write buffer 2601W is full.
  • the read / write switching control unit 2603 performs data processing of preprocessed image data stored (stored) in the observed read buffer 2601R and image processing stored (stored) in the observed write buffer 2601W.
  • the read / write switching signal RW is changed based on the data amount of the image data. More specifically, the read / write switching control unit 2603 performs read / write switching when the data amount of the preprocessed image data stored (stored) in the observed read buffer 2601 R becomes equal to or less than the second read switching threshold.
  • the signal RW is brought to "High" level to notify that read DMA transfer is to be prioritized.
  • the read / write switching control unit 2603 outputs Set to “Low” level to notify that priority is given to write DMA transfer.
  • the read / write switching control unit 2603 sets the read / write switching signal RW to the “High” level, and performs read DMA transfer between timing t12 and timing t13. It shows the timing.
  • the read / write switching control unit 2603 when performing bidirectional (write and read) DMA transfer with the DRAM 30, the read / write switching control unit 2603 performs DMA by the bus master 2601. The state of transfer is observed, and a read / write switching signal RW for notifying a DMA transfer to be performed preferentially is output to the bus arbiter 230. At this time, in the memory access device according to the first embodiment, the read / write switching control unit 2603 sends the read buffer 2601R or the write buffer 2601W to the bus master 2601 based on the first switching threshold or the second switching threshold.
  • the data amount of the stored (stored) image data is determined, and the read / write switching signal RW is changed at an early timing. That is, in the memory access device of the first embodiment, the read / write switching control unit 2603 changes the read / write switching signal RW in a state where the storage capacities of the read buffer 2601R and the write buffer 2601W have a certain margin. Then, in the memory access device according to the first embodiment, when the bus arbiter 230 receives (permits) an access request from the bus master 2601, it accepts the DMA transfer access request notified by the read / write switching signal RW (permission To do).
  • the memory access device switching from the data reading state to the data writing state in the DRAM 30 and the switching to the data reading state from the data writing state are appropriately performed. It can be carried out. That is, in the memory access device according to the first embodiment, the state of the DRAM 30 is switched from the data reading state to the data writing state, or from the data writing state to the data reading state Etc. The loss time of the predetermined time (fixed time) required for etc. will not be increased more than necessary. By this, in the memory access device of the first embodiment, a series of image processing by the image processing module 2602 and DMA transfer with the DRAM 30 can be smoothly performed.
  • the decrease in the transfer efficiency of the image data on the data bus 210 which can be a factor causing the system failure, is reduced. It can be (suppressed).
  • the read / write switching signal RW is changed (switched) using either the first switching threshold or the second switching threshold, and the read DMA transfer performed by the bus master 2601 is performed.
  • the operation of switching to the write DMA transfer has been described.
  • the operation of switching the DMA transfer in the image processing unit 260 is not limited to the operation using either the first switching threshold or the second switching threshold, and the first switching threshold and the first switching threshold may be used. Both of the switching thresholds of 2 and the switching threshold may be used to switch between read DMA transfer and write DMA transfer performed by the bus master 2601.
  • the read / write switching control unit 2603 performs each of the read buffer 2601 R and the write buffer 2601 W provided in the bus master 2601 in two stages using switching thresholds of both the first switching threshold and the second switching threshold.
  • the amount of data stored (stored) may be determined, and the state of the read / write switching signal RW may be changed to notify the DMA transfer to be performed preferentially.
  • the operation of switching between the read DMA transfer and the write DMA transfer performed by the bus master 2601 is the operation of switching the DMA transfer based on the first switching threshold shown in FIG. 4 and the second shown in FIG. Since the operation can be easily understood from the operation of switching the DMA transfer based on the switching threshold, the detailed description will be omitted.
  • a bus master (bus master 2601) that outputs an access request for requesting access to a memory (DRAM 30) connected to a data bus (data bus 210), and data of DRAM 30 accessed by the bus master 2601
  • the read access request (DMA transfer for read access: read DMA transfer) and the write access for writing data in the DRAM 30 are predicted among the access requests in the bus master 2601 in anticipation of stoppage of processing for
  • a read / write switching control unit read / write switching control unit (read / write switching control unit 2603) that notifies which access request (DMA transfer) with the requested write access request (write access DMA transfer: write DMA transfer) is prioritized
  • a bus arbiter (bus arbiter 230) for controlling access
  • the read / write switching control unit 2603 can set the read DMA transfer status output from the bus master 2601, the write access DMA transfer status output from the bus master 2601, and the bus master 2601.
  • the amount of data (preprocessed image data) stored in a read buffer (read buffer 2601 R) for storing data of a predetermined data amount read from the DRAM 30 and the data stored in the DRAM 30 provided in the bus master 2601 DMA transfer in the bus master 2601 by observing the data amount of data (image-processed image data (still image data and moving image data)) stored in the write buffer (write buffer 2601 W) for storing data of the defined data amount ,
  • Read DMA transfer When the read / write switching signal (read / write switching signal RW) for notifying which DMA transfer with write access DMA transfer is to be prioritized is output, and the bus arbiter 230 receives the DMA transfer output from the bus master 2601
  • the memory access device is configured to receive the prioritized DMA transfer notified by
  • the read / write switching control unit 2603 determines which of DMA transfer of read DMA transfer and DMA transfer of write access should be prioritized based on each observed state.
  • the switching threshold is generated, and the data amount of data (preprocessed image data) stored in the read buffer 2601R and the data amount of data (image-processed image data) stored in the write buffer 2601W are The amount of data (preprocessed image data) stored in the read buffer 2601 R or data stored in the write buffer 2601 W (image processed image data), which is determined using the switching threshold of 1 and the second switching threshold).
  • the memory access device is configured.
  • the switching threshold (first switching threshold) is used to determine the data amount of data (preprocessed image data) stored in the read buffer 2601R, and stored in the read buffer 2601R.
  • a processing module image processing module 2602 that performs processing (image processing) on the processed data (preprocessed image data) reads and processes data (preprocessed image data) stored in the read buffer 2601R (image processing) Processing (image processing) between the amount of data that can be started and the time required to switch the DRAM 30 from writing data to reading data (a predetermined (fixed) time loss time) Read switching threshold (first read switching threshold) plus the amount of data that can be Start writing (write DMA transfer) the data (image-processed image data) stored in the write buffer 2601 W, which is used to determine the data amount of data (image-processed image data) stored in the 2601 W
  • the image processing module 2602 performs processing (image processing) during the time necessary for switching the DRAM 30 from the state of reading data to the state of writing data (the
  • the switching threshold (second switching threshold) is used to determine the data amount of data (preprocessed image data) stored in the read buffer 2601R, and stored in the read buffer 2601R.
  • Time predetermined (constant) time required for the image processing module 2602 that processes the processed data (preprocessed image data) to switch the DRAM 30 from the state where data is being written to the state where data is read Processing (image processing) and the amount of data that can be processed (image processing) and data (preprocessed image data) read from the DRAM 30 before being stored in all storage capacities of the read buffer 2601R (image processing)
  • Read switching threshold (second read switching threshold) plus the amount of data that can be It is used to determine the data amount of data (image-processed image data) stored in buffer 2601W and stores data (image-processed image data) after image processing module 2602 performs processing (image processing) in write buffer 2601W.
  • a memory access apparatus is configured, which includes a light switching threshold (second light switching threshold) obtained by subtracting the amount of data that can be processed (image processing) by the image processing module 2602.
  • the read / write switching control unit 2603 reads and processes data (preprocessed image data) stored in the read buffer 2601R based on each observed state (image processing). Whether the processing (image processing) is kept waiting in the image processing module 2602 that stores data (image processing image data) after processing (image processing) in the write buffer 2601 W.
  • the amount of data (degree of congestion of the data bus 210) of data (including image data generated by other processing blocks) being delivered via the data bus 210 is predetermined (predetermined amount of congestion) Or not, and the image processing module 2602 has not waited for processing to occur or The image processing module 2602 is in a state where processing is kept waiting, but the data amount of data being delivered via the data bus 210 (degree of congestion of the data bus 210) is a predetermined amount When it is determined that the degree of congestion is not more than a predetermined degree of congestion, a first switching threshold value is generated to determine which of DMA transfer of read DMA transfer and DMA transfer of write access is to be prioritized.
  • the processing module 2602 is in a state where processing is kept waiting, and the data amount of data being transferred via the data bus 210 (the congestion degree of the data bus 210) is a predetermined data amount (predetermined If it is determined that the priority is higher than the congestion degree, it is determined which of DMA transfer of read DMA transfer and DMA transfer of write access is to be prioritized. To generate the second switching threshold value for the second buffer, and the data amount of the data (preprocessed image data) stored in the read buffer 2601R and the data amount of the data (image processed image data) stored in the write buffer 2601W.
  • a memory access device is configured to switch the prioritized DMA transfer indicated by the read / write switching signal RW.
  • the first switching threshold value is used to determine the data amount of data (preprocessed image data) stored in the read buffer 2601R, and the image processing module 2602 performs the read buffer 2601R.
  • the amount of data that can be read out (preprocessed image data) stored in (data) to start processing (image processing) and the time required to switch the DRAM 30 from the data writing state to the data reading state Data stored in the write buffer 2601 W (image processed image data) including a first read switching threshold value obtained by adding the amount of data that can be processed (image processing) during a predetermined (constant) time loss period) Of the data (image-processed image data) stored in the write buffer 2601 W and used to determine the data amount of The time required to switch the DRAM 30 from the data read state to the data write state from the amount of data that can start writing to the RAM 30 (write DMA transfer) (a predetermined (fixed) time loss time) And the first write switching threshold obtained by subtracting the amount of data that can be processed (image processing)
  • a loss of time (predetermined (fixed) time) which is used to determine the data amount of (preprocessed image data) and which is required when the image processing module 2602 switches the DRAM 30 from the state where data is being written to the state where data is read Amount of data that can be processed (image processing) during the
  • the second read switching threshold including the amount of data that can be processed (image processing) while storing the output data in all the storage capacities of the read buffer 2601R, and the data stored in the write buffer 2601W
  • Data amount that is used to determine the data amount of data (image-processed image data) and can store data (image-processed image data) after the image processing module 2602 performs processing (image processing) in the write buffer 2601W The amount of data that can be processed (image processing) by the image processing module 2602 during the time required to switch the DRAM 30 from the data reading state to the data writing state from (the storage capacity of the write buffer 2601 W)
  • a second write switching threshold minus Device is configured.
  • the bus master for outputting an access request for requesting access to the memory (DRAM 30) connected to the data bus (data bus 210), and the DRAM 30 accessed by the bus master 2601.
  • Read access request (DMA transfer for read access: read DMA transfer) for requesting read access to read data from the DRAM 30 among access requests in the bus master 2601 in anticipation of stoppage of processing for the data of Read / write switching control unit (read / write switching control unit 260 for notifying which access request (DMA transfer: write access DMA transfer: write access request for requesting access) is to be prioritized
  • the data bus 210 to arbitrate DMA transfer to the DRAM 30, and when the DMA transfer to the DRAM 30 output from the bus master 2601 is accepted, the prioritized DMA transfer notified by the read / write switching control unit 2603 is
  • An image processing apparatus (image processing apparatus 20) including a memory access device (memory access device) equipped with a bus arbiter (bus arbiter 230) for controlling access
  • the bus master for outputting an access request for requesting access to the memory (DRAM 30) connected to the data bus (data bus 210), and the DRAM 30 accessed by the bus master 2601.
  • Read access request (DMA transfer for read access: read DMA transfer) for requesting read access to read data from the DRAM 30 among access requests in the bus master 2601 in anticipation of stoppage of processing for the data of Read / write switching control unit (read / write switching control unit 260 for notifying which access request (DMA transfer: write access DMA transfer: write access request for requesting access) is to be prioritized
  • the data bus 210 to arbitrate DMA transfer to the DRAM 30, and when the DMA transfer to the DRAM 30 output from the bus master 2601 is accepted, the prioritized DMA transfer notified by the read / write switching control unit 2603 is Image processing apparatus (image processing apparatus 20) including a memory access device (memory access device) including a bus arbiter (bus arbiter 230) for controlling access to the
  • the read / write switching control unit 2603 when performing bidirectional (write and read) DMA transfer with the DRAM 30, the read / write switching control unit 2603 performs DMA transfer by the bus master 2601. Observe the state. Then, in the memory access device according to the first embodiment, DMA transfer for read (read DMA transfer) and DMA transfer for write (write DMA transfer (write DMA) based on the state of DMA transfer by the bus master 2601 observed by the read / write switching control unit 2603 Among the transfer and transfer), the read / write switching signal RW for notifying of the DMA transfer which is desired to be performed preferentially is output to the bus arbiter 230.
  • the bus arbiter 230 receives (permits) an access request from the bus master 2601, it receives the DMA transfer access request of the one notified by the read / write switching signal RW. Can (permit).
  • the read / write switching control unit 2603 stores the read buffer 2601R or the write buffer 2601W provided in the bus master 2601 based on the first switching threshold or the second switching threshold.
  • the data amount of the (stored) image data is determined, and the read / write switching signal RW is changed at an early timing.
  • the state necessary for DMA transfer is ready by the time the access request output from the bus master 2601 is accepted (permitted) by the bus arbiter 230.
  • the read provided to the bus master 2601 is performed by the time the access request for the read DMA transfer output by the bus master 2601 is accepted (permitted) by the bus arbiter 230.
  • the buffer 2601R a storage capacity of an amount capable of storing preprocessed image data acquired (read) from the DRAM 30 by read DMA transfer can be secured.
  • the write buffer 2601 W provided in the bus master 2601 is received by the time the access request for the write DMA transfer output by the bus master 2601 is accepted (permitted) by the bus arbiter 230. Image processed image data to be stored (written) in the DRAM 30 by write DMA transfer is complete.
  • image processing by the image processing module 2602 and DMA transfer with the DRAM 30 can be smoothly performed.
  • the state of the DRAM 30 is switched from the data reading state to the data writing state
  • the loss time of the predetermined time (fixed time) necessary when switching from the state in which data is written to the state in which data is read is not increased more than necessary. That is, it is possible to reduce (suppress) the decrease in the transfer efficiency of the image data on the data bus 210, which may cause the system in which the memory access device of the first embodiment is mounted to be broken.
  • the image processing module 2602 that performs processing on image data transferred between the memory access device of the first embodiment and the DRAM 30 can smoothly perform a series of image processing on the image data.
  • a memory access device that performs bidirectional DMA transfer with the DRAM 30 may be configured by providing a plurality of bus masters that perform unidirectional DMA transfer. More specifically, by providing one bus master for performing DMA transfer in the access direction for writing in the DRAM 30 and one bus master for performing DMA transfer in the access direction for reading in the DRAM 30, bi-directional DMA can be performed between the DRAM 30 and the DRAM 30.
  • a memory access device that performs transfer may be configured.
  • the bus master constituting the memory access apparatus is divided into a bus master performing DMA transfer in the access direction for writing and a bus master performing DMA transfer in the access direction for reading.
  • Configuration when the memory access device according to the second embodiment of the present invention is included in an image processing device mounted in an imaging device such as a still image camera or a moving image camera, for example. Will be explained.
  • FIG. 6 is a block diagram showing a schematic configuration of an image pickup apparatus equipped with an image processing apparatus provided with a memory access apparatus according to a second embodiment of the present invention.
  • An image processing unit provided with the memory access device according to the first embodiment shown in FIG. 1 has the configuration of the imaging device equipped with the image processing device provided with the memory access device according to the second embodiment shown in FIG.
  • the same components as the imaging device 1 on which the 260 is mounted are included. Therefore, among the components of the imaging apparatus equipped with the image processing apparatus equipped with the memory access apparatus according to the second embodiment, an imaging apparatus 1 equipped with the image processing unit 260 equipped with the memory access apparatus according to the first embodiment
  • the same components as those of the components are denoted by the same reference numerals, and the detailed description of the components is omitted.
  • the configuration of the image processing apparatus provided with the memory access device of the second embodiment shown in FIG. 6 is the same as that of the image processing unit 260 provided with the memory access device of the first embodiment shown in FIG. Contains the components of. Therefore, in the components of the image processing apparatus including the memory access device of the second embodiment, the same components as the components of the image processing unit 260 including the memory access device of the first embodiment are the same. And the detailed description of each component is omitted.
  • the imaging device 2 illustrated in FIG. 6 includes an image sensor 10, an image processing device 21, a DRAM 30, and a display device 40.
  • the image processing apparatus 21 further includes a CPU 220, a bus arbiter 231, a DRAM interface unit 240, a preprocessing unit 250, an image processing unit 261, and a display processing unit 270.
  • the image processing unit 261 further includes a bus master 2611, an image processing module 2602, a bus master 2613, and a read / write switching control unit 2614.
  • the bus master 2611 also includes a read buffer 2611R.
  • the bus master 2613 includes a write buffer 2613W.
  • each of the bus arbiter 231, the preprocessing unit 250, the image processing unit 261, and the display processing unit 270 is connected to the common data bus 210.
  • the bus master 2611, the bus master 2613, the read / write switching control unit 2614, and the bus arbiter 231, which are included in the image processing unit 261 in the image processing apparatus 21, have a second configuration. It corresponds to the memory access device of the embodiment.
  • the imaging device 2 captures a still image or a moving image of a subject with the image sensor 10, and a display image corresponding to the captured still image or the moving image Is displayed on the display device 40.
  • the imaging device 2 can also record a recorded image corresponding to a photographed still image or moving image on a recording medium (not shown), as in the case of the imaging device 1 in the first embodiment.
  • the image processing apparatus 21 performs predetermined image processing on the pixel signal output from the image sensor 10 to obtain a still image or a moving image. Generate an image. Further, the image processing device 21 generates a display image corresponding to the generated still image or moving image, and causes the display device 40 to display the generated display image, as in the image processing device 20 according to the first embodiment. Further, the image processing apparatus 21 generates a recording image according to the generated still image or moving image as in the image processing apparatus 20 in the first embodiment, and records the generated recording image on a recording medium (not shown). You can also
  • each of the preprocessing unit 250, the image processing unit 261, and the display processing unit 270 is a processing block that realizes the processing function of the image processing performed by the image processing device 21.
  • each of the preprocessing unit 250, the image processing unit 261, and the display processing unit 270 accesses the DRAM 30 by DMA transfer via the data bus 210.
  • the bus arbiter 231 uses DMA transfer from each processing block in the image processing device 21 connected to the data bus 210.
  • the DMA arbitration circuit arbitrates an access request (DMA request) to the DRAM 30 and transfers data via the data bus 210 with the processing block that has received the access request.
  • the bus arbiter 231 also outputs an access request signal (DMA request signal) based on the priority of each processing block provided in the image processing device 21 as in the bus arbiter 230 that configures the memory access device of the first embodiment. Accept (permit) access requests from each processing block that has been sent. However, when the urgency level signal UR is output from the image processing unit 261, the bus arbiter 231 increases the priority of the image processing unit 261 and preferentially receives an access request from the image processing unit 261 (see FIG. To give permission).
  • DMA request signal an access request signal
  • the bus arbiter 231 determines that the image processing unit 261 is a processing block that accepts (permits) an access request to the DRAM 30, as in the bus arbiter 230 that configures the memory access device of the first embodiment Based on the read / write switching signal RW output from the image processing unit 261, the access direction (writing or reading) to the DRAM 30 to be accepted (permitted) is switched.
  • the image processing unit 261 performs predetermined image processing on preprocessed image data stored in the DRAM 30. It is a processing block to apply.
  • the image processing unit 261 also performs DMA transfer (read DMA transfer) for acquiring (reading) preprocessed image data to be subjected to image processing, and stores (writes) the image data generated by performing the image processing in the DRAM 30. And DMA transfer (write DMA transfer).
  • the image processing unit 261 includes the bus master 2611, the image processing module 2602, the bus master 2613, and the read / write switching control unit 2614.
  • the bus master 2611 is a DMA transfer unit that performs read DMA transfer in which the image processing module 2602 acquires (reads) preprocessed image data that is an object of image processing from the DRAM 30. That is, the bus master 2611 is a DMA transfer unit that performs one-way (read) DMA transfer with the DRAM 30. As described above, the bus master 2611 includes the read buffer 2611R.
  • the read buffer 2611R is, like the read buffer 2601R provided in the bus master 2601 of the memory access device of the first embodiment shown in FIG. Are temporarily stored (saved).
  • the read buffer 2611R is also configured by, for example, a memory such as an SRAM.
  • the bus master 2611 temporarily stores (stores) preprocessed image data acquired (read) from the DRAM 30 by DMA transfer in the read buffer 2611R, and stores (stores) preprocessed image data of a predetermined data amount. Later, in response to a request from the image processing module 2602, the stored (stored) preprocessed image data is output to the image processing module 2602. That is, the bus master 2611 outputs the preprocessed image data acquired (read) from the DRAM 30 by DMA transfer to the image processing module 2602 in synchronization with the timing at which the image processing module 2602 performs image processing.
  • the bus master 2613 is a DMA transfer unit that performs write DMA transfer that causes the DRAM 30 to store (write) image-processed image data (still image data and moving image data) after the image processing module 2602 performs image processing. That is, the bus master 2613 is a DMA transfer unit that performs unidirectional (write) DMA transfer with the DRAM 30. As described above, the bus master 2613 includes the write buffer 2613W.
  • the write buffer 2613 W performs image processing image data of a predetermined data amount (for example, the number of pixels)
  • This data storage unit temporarily stores (saves) (still image data and moving image data).
  • the write buffer 2613W is also configured of, for example, a memory such as an SRAM.
  • the bus master 2613 temporarily stores (saves) image processed image data (still image data and moving image data) generated by the image processing module 2602 by performing image processing in the write buffer 2613 W, and has a predetermined data amount. After storing (saving) the image-processed image data, the stored (saved) image-processed image data is output to the bus arbiter 231 and stored (written) in the DRAM 30 at the timing of DMA transfer.
  • the read / write switching control unit 2614 observes the state of the read DMA transfer performed by the bus master 2611 and the state of the write DMA transfer performed by the bus master 2613.
  • the read / write switching control unit 2614 performs DMA transfer of each of the observed bus master 2611 and bus master 2613 as in the read / write switching control unit 2603 of the memory access device according to the first embodiment shown in FIG.
  • the bus arbiter 231 On the basis of the state of (1), notifies the access direction (write or read) to the DRAM 30 in the image processing unit 261 that the access request is to be accepted (permitted).
  • the read / write switching control unit 2614 requests the read access that the bus master 2611 acquires (reads) the preprocessed image data from the DRAM 30, and accepts (permits) the request for the read access, the read buffer 2611R.
  • the state of the read DMA transfer by the bus master 2611 is observed by observing each of the data amounts of the preprocessed image data stored (stored).
  • the image processing unit 261 shown in FIG. 6 observes the read access request and acceptance (permission) by the bus master 2611 by the read access observation signal RA, and the preprocessed image stored in the read buffer 2611R by the read buffer observation signal RB. The amount of data is observed.
  • the read access observation signal RA is, for example, an access request signal (DMA request signal) for the bus master 2611 to request a read access, and an access acceptance signal (DMA permission signal) for the bus arbiter 231 to receive the read access request.
  • the read buffer observation signal RB is a signal indicating whether or not preprocessed image data is stored (stored) in all the storage capacities of the read buffer 2611R, and storage of more than a predetermined ratio in the read buffer 2611R. It is a signal indicating whether or not preprocessed image data is stored (stored) in the capacity.
  • the read / write switching control unit 2614 requests the write access for the bus master 2613 to store (write) the image-processed image data (still image data and moving image data) in the DRAM 30, and accepts the write access request (permission).
  • the state of the write DMA transfer by the bus master 2613 is observed by observing each of the data amount of the image processed image data stored (stored) in the write buffer 2613 W.
  • the image processing unit 261 shown in FIG. 6 observes the request and acceptance (permission) of write access by the bus master 2613 by the write access observation signal WA, and the image processed image stored in the write buffer 2613 W by the write buffer observation signal WB The amount of data is observed.
  • the write access observation signal WA is, for example, an access request signal (DMA request signal) for the bus master 2613 to request a write access, and an access acceptance signal (DMA permission signal) for the bus arbiter 231 to receive the request for write access.
  • the write buffer observation signal WB is a signal indicating whether or not image processing image data is stored (stored) in all the storage capacities of the write buffer 2613 W, and the storage of more than a predetermined ratio in the write buffer 2613 W It is a signal indicating whether or not image processing image data is stored (stored) in the capacity.
  • the read / write switching control unit 2614 Similar to the read / write switching control unit 2603 of the memory access device according to the first embodiment shown in FIG. It is determined which of DMA transfer of read DMA transfer and write DMA transfer by the bus master 2613 is to be prioritized. Then, like the read / write switching control unit 2603 of the memory access device of the first embodiment shown in FIG. 1, the read / write switching control unit 2614 wants to prioritize DMA based on the determination result.
  • a read / write switching signal RW is generated to notify transfer, that is, a DMA transfer for which the bus arbiter 231 wants to receive (permit) an access request.
  • the parameter used by the read / write switching control unit 2614 to determine the priority DMA transfer is set by the CPU 220 in the register of the read / write switching control unit 2614.
  • the read / write switching control unit 2614 outputs the generated read / write switching signal RW to the bus arbiter 231, thereby notifying DMA transfer (read DMA transfer or write DMA transfer) that is desired to be performed preferentially.
  • the bus arbiter 231 receives (permits) an access request from the image processing unit 261
  • the bus master 2611 acquires (reads) preprocessed image data from the DRAM 30 based on the read / write switching signal RW.
  • the transfer or the bus master 2613 receives (permits) an access request for DMA transfer of either one of write DMA transfer for causing the DRAM 30 to store (write) the image processing image data.
  • the read / write switching control unit 2614 notifies the urgent degree of DMA transfer of each of the bus master 2611 and the bus master 2613 according to the state of the image processing performed by the image processing module 2602.
  • the read / write switching control unit 2614 performs read DMA transfer performed by the bus master 2611 and write DMA transfer performed by the bus master 2613 based on the state (for example, progress) of the image processing performed by the image processing module 2602. And an emergency level threshold value for determining the level of urgency in each DMA transfer.
  • the read / write switching control unit 2614 compares the state of DMA transfer of each of the observed bus master 2611 and bus master 2613 with the calculated degree of urgency threshold to determine the degree of urgency in read DMA transfer and write DMA transfer. judge.
  • the read / write switching control unit 2614 generates the urgency level signal UR for notifying the urgency of each of the DMA transfer of the read DMA transfer and the write DMA transfer based on the determined result.
  • the read / write switching control unit 2614 calculates an urgency threshold for determining the degree of urgency of each of DMA transfer of read DMA transfer and write DMA transfer corresponding to the image processing performed by the image processing module 2602.
  • the parameters used for the are set by the CPU 220 in the register of the read / write switching control unit 2614.
  • the parameters used to calculate the urgency level threshold are not limited to the configuration that the CPU 220 sets in the register of the read / write switching control unit 2614.
  • the image processing module 2602 may be configured to sequentially set or notify the read / write switching control unit 2614 as a parameter used to calculate the threshold value of the image processing that is being executed.
  • a component that monitors the state (for example, progress, etc.) of the image processing being executed by the image processing module 2602 is provided inside or outside of the image processing unit 261, and this component monitors the monitored image processing
  • the parameter used to calculate the urgency level threshold may be sequentially set or notified to the read / write switching control unit 2614 based on the state of (1).
  • the read / write switching control unit 2614 notifies the urgency of each DMA transfer (read DMA transfer or write DMA transfer) by outputting the generated emergency degree signal UR to the bus arbiter 231. Thereby, when the bus arbiter 231 arbitrates the access request from each processing block in the image processing apparatus 21 connected to the data bus 210, the access from the image processing unit 261 is performed according to the urgency level signal UR. Arbitration is performed with high priority for accepting (permitting) requests.
  • the imaging device 2 captures a still image or a moving image of a subject by the image sensor 10, and causes the display device 40 to display a display image corresponding to the captured still image or the moving image.
  • the imaging device 2 can also record a recorded image corresponding to a still image or a moving image captured by the image sensor 10 on a recording medium (not shown).
  • the memory access device includes the bus master 2611, the bus master 2613, the read / write switching control unit 2614, and the bus arbiter 231 provided in the image processing unit 261 in the image processing device 21.
  • the image processing unit 261 is a processing block that performs bidirectional (write and read) DMA transfer with the DRAM 30.
  • the memory access device of the second embodiment is configured.
  • the read / write switching control unit 2614 performs read DMA transfer performed by the bus master 2611. And the state of the write DMA transfer performed by the bus master 2613. Then, in the memory access device of the first embodiment, as in the memory access device of the first embodiment, the read / write switching control unit 2614 is in the DMA transfer state of the observed bus master 2611 and bus master 2613. Based on the priority, the read / write switching signal RW for notifying of the DMA transfer (read DMA transfer or write DMA transfer) to be performed preferentially is output to the bus arbiter 231.
  • the bus arbiter 231 reads (accepts) access requests from the bus master 2611 and the bus master 2613 as in the memory access device of the first embodiment. It accepts (permits) an access request for DMA transfer, which is notified by the write switching signal RW.
  • the bus arbiter 231 reads (accepts) access requests from the bus master 2611 and the bus master 2613 as in the memory access device of the first embodiment. It accepts (permits) an access request for DMA transfer, which is notified by the write switching signal RW.
  • a loss time of a predetermined time (fixed time) necessary for switching the state of the DRAM 30 from one state of reading data to writing of data to the other state is longer than necessary. Will not be increased.
  • the read / write switching control unit 2614 is based on the parameters related to the image processing performed by the image processing module 2602 and the DMA transfer states of the observed bus master 2611 and bus master 2613
  • the urgency level of the DMA transfer is determined, and the urgency level signal UR for notifying the determined urgency level is output to the bus arbiter 231.
  • the bus arbiter 231 receives an access request from the image processing unit 261 in response to the urgency level signal UR when arbitrating the access request from each processing block. Arbitrate with high priority (permit).
  • the bus arbiter 231 when the urgency of the image processing executed by the image processing unit 261 becomes high, the bus arbiter 231 generates the bus master 2611 or the bus master based on the read / write switching signal RW.
  • the access request from 2613 can be preferentially received (permitted).
  • the transfer efficiency of image data on the data bus 210 which can be a factor causing the system failure, is reduced.
  • the image processing module 2602 that performs processing on image data transferred between the memory access device of the second embodiment and the DRAM 30 can smoothly perform a series of image processing.
  • FIG. 7 is a flow chart showing the processing procedure of notification processing in the memory access apparatus of the second embodiment of the present invention.
  • the read / write switching control unit 2614 requests the read access in the read DMA transfer performed by the bus master 2611 and the data amount of the preprocessed image data stored (stored) in the read buffer 2611 R and performed by the bus master 2613.
  • Each of the write access request in the write DMA transfer and the data amount of the image-processed image data stored (stored) in the write buffer 2613 W is observed as the state of the DMA transfer.
  • the read / write switching control unit 2614 calculates a degree of urgency threshold for determining the degree of urgency of each of the read DMA transfer and the write DMA transfer corresponding to the image processing performed by the image processing module 2602. The parameters used for are set in the register.
  • the read / write switching control unit 2614 first performs a process of DMA transfer switching determination based on the observed DMA transfer state (step S100). That is, the read / write switching control unit 2614 performs processing to determine which of DMA transfer of read DMA transfer and write DMA transfer is to be performed with priority.
  • the read / write switching control unit 2614 performs a process of determining the urgency of DMA transfer based on the observed DMA transfer state and the parameters set in the register (step S200). That is, the read / write switching control unit 2614 performs processing to determine the degree of urgency of DMA transfer of each of read DMA transfer and write DMA transfer.
  • step S100 The process of the DMA transfer switching determination performed by the read / write switching control unit 2614 in step S100 is the same as the process of determining the DMA transfer switching in the memory access device of the first embodiment shown in FIG. Therefore, the detailed description of the processing for determination of switching of DMA transfer in the read / write switching control unit 2614 is omitted.
  • FIG. 8 is a flow chart showing a processing procedure of processing for determining the urgency of DMA transfer in the memory access apparatus of the second embodiment of the present invention.
  • the read / write switching control unit 2614 first uses the parameters related to the image processing performed by the image processing module 2602 set in the register to perform each of read DMA transfer and write DMA transfer.
  • step S210 The method of calculating the emergency degree threshold value calculated by the read / write switching control unit 2614 in step S210 will be described later.
  • the waiting time for each DMA transfer of read DMA transfer and write DMA transfer is that the access request for read DMA transfer and the access request for write DMA transfer are accepted (permitted) by the bus arbiter 231. It's time to wait for More specifically, the waiting time for read DMA transfer is an elapsed time from when the bus master 2611 outputs an access request for read DMA transfer to the bus arbiter 231. That is, the waiting time for read DMA transfer is the difference between the time when the bus master 2611 outputs the access request and the current time.
  • the wait time for write DMA transfer is an elapsed time from when the bus master 2613 outputs an access request for write DMA transfer to the bus arbiter 231.
  • the waiting time of the write DMA transfer is the difference time between the time when the bus master 2613 outputs the access request and the current time.
  • the read / write switching control unit 2614 waits for each DMA transfer of read DMA transfer and write DMA transfer.
  • the time of the difference calculated in step S120 may be used when the DMA transfer switching determination process (step S100) is performed.
  • the read / write switching control unit 2614 compares the calculated waiting time with the urgency level threshold, and determines whether the calculated waiting time is longer than the urgency level threshold (step S220).
  • step S220 When it is determined in step S220 that the calculated waiting time is not longer than the emergency threshold (“NO” in step S220), the read / write switching control unit 2614 determines the DMA transfer state corresponding to the determined waiting time as It is determined that the degree of urgency is not high (low), and the process proceeds to step S230. Then, the read / write switching control unit 2614 generates a degree-of-urgency signal UR indicating that the degree of urgency of DMA transfer corresponding to the determined waiting time is low (step S230).
  • step S220 when it is determined in step S220 that the calculated waiting time is longer than the emergency level threshold ("YES" in step S220), the read / write switching control unit 2614 determines the DMA transfer state corresponding to the determined waiting time. It is determined that the degree of urgency is high, and the process proceeds to step S240. Then, the read / write switching control unit 2614 generates a degree-of-urgency signal UR indicating that the degree of urgency of DMA transfer corresponding to the determined waiting time is high (step S240).
  • the read / write switching control unit 2614 outputs the urgency level signal UR generated in step S230 or step S240 to the bus arbiter 231.
  • the read / write switching control unit 2614 performs the process of determining the degree of urgency in step S200 on each of the bus master 2611 and the bus master 2613. More specifically, the read / write switching control unit 2614 performs the determination in step S220 for each of the waiting time of the read DMA transfer by the bus master 2611 and the waiting time of the write DMA transfer by the bus master 2613. Accordingly, the read / write switching control unit 2614 can determine the degree of urgency separately for the read DMA transfer by the bus master 2611 and the write DMA transfer by the bus master 2613. As a result, the bus arbiter 231 is notified of the urgency of each DMA transfer (read DMA transfer and write DMA transfer).
  • the emergency degree threshold value is calculated using the parameter related to the image processing performed by the image processing module 2602 set in the register of the read / write switching control unit 2614. Note that there are various calculation methods corresponding to the image processing performed by the image processing module 2602 as the calculation method of the urgency level threshold in the read / write switching control unit 2614.
  • the first calculation method specifies the urgency of DMA transfer based on the limit time until the end of DMA transfer, which specifies that no waiting state occurs in image processing performed by the image processing module 2602 This is a method of calculating an emergency degree threshold value for determination. That is, in the first calculation method, it is considered on the basis that the image processing module 2602 completes the image processing by the defined limit time.
  • the read / write switching control unit 2614 calculates the emergency degree threshold value by the following equation (5).
  • Urgency threshold limit time ⁇ loss time coefficient (5)
  • the limit time is the limit time until the end of the DMA transfer.
  • the limit time defines, for example, the time until the end of the DMA transfer, which is necessary to prevent the occurrence of a wait state in the image processing performed by the image processing module 2602.
  • the loss time coefficient is a coefficient for giving a margin to the limit time. More specifically, the loss time factor is, for example, a predetermined time (fixed time) required when switching from one state of reading data to writing of data in the DRAM 30 to the other state, etc. Even if a loss time occurs, it is a coefficient for providing a margin such that DMA transfer is completed by the limit time while avoiding the influence of the loss time.
  • the loss time factor is defined as a percentage (%) of the limit time.
  • the limit time and loss time coefficient for the read / write switching control unit 2614 to calculate the emergency threshold by the first calculation method are read / write switched by the CPU 220 as parameters used to calculate the emergency threshold. It is set in the register of the control unit 2614.
  • the second calculation method is a method of calculating an urgency threshold for determining the urgency of DMA transfer based on the processing time when the image processing module 2602 performs image processing of image data for one frame. .
  • the image processing module 2602 completes image processing of image data of one frame by the requested processing time, that is, delay in image processing of image data of one frame does not occur.
  • the basic idea is to secure the time for DMA transfer of image data for one frame, which is necessary to
  • the read / write switching control unit 2614 calculates the emergency degree threshold value by the following equations (6) to (11).
  • Processing allowance time request processing time-fastest processing time (7)
  • Allowable time fastest processing time + processing allowance time x loss time coefficient ... (8)
  • Urgency threshold remaining permissible time-remaining required processing time (11)
  • the fastest processing time is the processing time when the image processing module 2602 performs the image processing for one frame at the fastest.
  • the processing speed is the processing speed at which the image processing module 2602 performs image processing on preprocessed image data of one pixel. In other words, the processing speed is the processing time required for the image processing module 2602 to perform image processing of preprocessed image data of one pixel.
  • the total number of output pixels is the number of pixels of image processing image data (still image data or moving image data) for one frame output and processed by the image processing module 2602.
  • the processing allowance time is a margin time which exists until the image processing module 2602 ends the image processing for one frame. In other words, when the image processing module 2602 does not finish the image processing for one frame even if the processing allowance time exceeds this time, a system (image pickup apparatus 2) equipped with the memory access device of the second embodiment And the image processing device 21).
  • the request processing time is the image processing of one frame in the image processing module 2602 in the system (the imaging device 2 or the image processing device 21) equipped with the memory access device of the second embodiment. Processing time required to complete the The request processing time is the time excluding the time during which the control and processing by the program executed by the CPU 220 intervene when the image processing module 2602 performs the image processing. That is, the required processing time is a time required only for image processing in the image processing module 2602.
  • the fastest processing time is the fastest processing time calculated in the above equation (6).
  • the allowable time is a delay time which is permitted before the image processing module 2602 completes the image processing for one frame.
  • the fastest processing time is the fastest processing time calculated in the above equation (6).
  • the process margin time is the process margin time calculated in the above equation (7).
  • the loss time coefficient is a coefficient for further providing a margin to the processing allowance time. The loss time coefficient is defined as a ratio (percentage) to the processing margin time based on the same concept as the loss time coefficient in the above equation (5) of the first calculation method.
  • a loss time of a predetermined time (certain time) required when switching from one state of reading data to writing of data to the other state occurs. Even in such a case, the influence of the loss time is avoided, and a ratio (percent) for providing a margin so that the DMA transfer is completed within the processing allowance time is specified.
  • the remaining necessary processing time is the processing time required for the image processing module 2602 to finish the image processing for one frame.
  • the remaining number of output pixels is output before the image processing module 2602 performs image processing and outputs image processing image data (still image data and moving image data) for one frame. This is the number of pixels required. That is, the remaining number of output pixels is the number of pixels of the image processed image data which the image processing module 2602 has not processed and output at the present time.
  • the processing speed is the same as the processing speed in the above equation (6).
  • the remaining allowable time is the time currently allowed to be delayed before the image processing module 2602 completes the image processing for one frame.
  • the permissible time is the permissible time calculated in the above equation (8).
  • the current elapsed time is the elapsed time from when the image processing module 2602 starts the image processing to the current time.
  • the remaining permissible time is the remaining permissible time calculated in the above equation (10). Further, in the above equation (11), the remaining necessary processing time is the remaining necessary processing time calculated in the above equation (9).
  • the read / write switching control unit 2614 calculates the emergency degree threshold value by the above equations (6) to (11).
  • the relationship between the respective times (values) calculated in the above equations (6) to (11) to calculate the emergency degree threshold value by the second calculation method is as shown in FIG. ing.
  • FIG. 9 shows an example of the relationship of time in each stage when calculating the urgency threshold for determining the urgency of DMA transfer in the memory access apparatus of the second embodiment of the present invention.
  • the processing speed, the total number of output pixels, the request processing time, and the loss time are used in the above equations (6) to (11) for the read / write switching control unit 2614 to calculate the urgency threshold by the second calculation method
  • Each of the coefficient, the number of remaining output pixels, and the current elapsed time is set by the CPU 220 in the register of the read / write switching control unit 2614 as a parameter used to calculate the urgency level threshold.
  • the remaining number of output pixels used in the above equation (9) and the current elapsed time used in the above equation (10) for the read / write switching control unit 2614 to calculate the emergency degree threshold value by the second calculation method are
  • the image processing module 2602 may be configured to sequentially set or notify the read / write switching control unit 2614.
  • this component Based on the monitored image processing state, the read / write switching control unit 2614 is sequentially set or notified of the remaining number of output pixels used in the above equation (9) and the current elapsed time used in the above equation (10). It may be a configuration.
  • the image processing module 2602 divides an area of one frame into a plurality of rectangular blocks including preprocessed image data having the same number of pixels, and performs image processing for each of the divided blocks.
  • the urgency threshold for determining the urgency of DMA transfer is calculated based on the processing time of image processing for each block.
  • the third calculation method is based on the same idea as the second calculation method, and changes are made to correspond to the image processing performed by the image processing module 2602 for each divided block.
  • the remaining required processing time calculated by the above equation (9) among the above equations (6) to (11) in the second calculation method is the read / write switching control unit 2614,
  • the urgency threshold is calculated by calculating using the following equation (12).
  • Remaining required processing time number of remaining blocks ⁇ number of pixels of one block ⁇ processing speed (12)
  • the remaining necessary processing time is the processing time required to complete the image processing of all the blocks divided by the image processing module 2602. That is, the remaining necessary processing time calculated by the read / write switching control unit 2614 in the above equation (12) is also the same as the remaining necessary processing time calculated in the above equation (9) of the second calculation method. Processing time required to complete image processing for one frame 2602 is shown.
  • the remaining number of blocks is the number of blocks that need to be processed before the image processing module 2602 outputs image processing image data (still image data or moving image data) for one frame. It is a number. That is, in the blocks divided by the image processing module 2602, the number of remaining blocks is the number of blocks for which image processing has not been completed at the present time.
  • the number of pixels in one block is the number of pixels included in each block divided by the image processing module 2602.
  • the processing speed is the same as the processing speed in the above equation (6) and the above equation (9) of the second calculation method.
  • the read / write switching control unit 2614 calculates the emergency degree threshold value by the above equations (6) to (8), the above equation (12), and the above equations (10) to (11).
  • each calculated in the above equations (6) to (8), the above equation (12), and the above equations (10) to (11) The relationship of time (value) of is the same as the relationship shown in FIG. 9 in the second calculation method.
  • the number of remaining blocks, the number of pixels in one block, and the processing speed used by the read / write switching control unit 2614 in the above equation (12) to calculate the urgency threshold in the third calculation method are urgency
  • the CPU 220 sets it in the register of the read / write switching control unit 2614.
  • the speed, the total number of output pixels, the request processing time, the loss time coefficient, and the current elapsed time are also set in the register of the read / write switching control unit 2614 by the CPU 220 as parameters used to calculate the emergency threshold. ing.
  • the remaining number of blocks used in the above equation (12) for the read / write switching control unit 2614 to calculate the emergency threshold value by the third calculation method is, for example, the read / write switching control unit 2614 for the image processing module 2602. It may be configured to set or notify to Furthermore, for the current elapsed time used in the above equation (10) for the read / write switching control unit 2614 to calculate the emergency degree threshold value by the third calculation method, for example, the image processing module 2602 controls the read / write switching control unit 2614.
  • this component may be configured to set or notify to Also, for example, when a component that monitors the state (for example, progress) of the image processing being executed by the image processing module 2602 is provided inside or outside the image processing unit 261, this component A configuration in which the number of remaining blocks used in the above equation (12) and the current elapsed time used in the above equation (10) are sequentially set or notified to the read / write switching control unit 2614 based on the monitored image processing state. It may be
  • a fourth method of calculating the urgency level threshold when the image processing module 2602 divides an area of one frame into a plurality of blocks and performs image processing, even when the number of pixels included in each block is different, an image for each block is generated.
  • This is a method of calculating an urgency threshold for determining the urgency of DMA transfer based on the processing time of processing. Examples of image processing in which the number of pixels included in each block divided by the image processing module 2602 to perform image processing are different include, for example, distortion correction processing and the like. That is, this is image processing in which the time required for processing is different for each of the divided blocks.
  • the fourth calculation method is based on the same idea as the second calculation method, and the image processing module 2602 performs image processing corresponding to each block having a different number of pixels. Make changes to do that.
  • the remaining required processing time calculated by the above equation (9) among the above equations (6) to (11) in the second calculation method is the read / write switching control unit 2614,
  • the urgency threshold is calculated by calculating the following equation (13).
  • a variable for calculating the remaining necessary processing time by the following equation (13) is calculated by the following equation (14).
  • Remaining input pixel number total input pixel number-current input pixel number (14)
  • the remaining necessary processing time is the processing time required to complete the image processing of all the blocks divided by the image processing module 2602. That is, the remaining necessary processing time calculated by the read / write switching control unit 2614 in the above equation (13) is also calculated in the above equation (9) of the second calculation method or the above equation (12) of the third calculation method. Similar to the remaining necessary processing time, the processing time required for the image processing module 2602 to finish the image processing for one frame. Further, in the above equation (13), the remaining number of input pixels is calculated in the above equation (14), and the image processing module 2602 outputs image processing image data (still image data and moving image data) for one frame. It is the number of pixels included in all blocks that need to be subjected to image processing.
  • the remaining number of input pixels is the number of pixels included in each block which has not been subjected to the image processing at the current time in each block divided by the image processing module 2602.
  • the remaining number of input pixels is the sum of the number of different pixels included in each block for which image processing has not been completed at the present time.
  • the processing speed is the same as the processing rate in the above equation (6) and the above equation (9) of the second calculation method, and the above equation (12) of the third calculation method .
  • the total input pixel count is all input to the image processing module 2602 until the image processing module 2602 outputs image processing image data (still image data and moving image data) for one frame.
  • the image processing module 2602 may use preprocessed image data of the same pixel for image processing of different blocks in order to perform image processing (for example, distortion correction processing) on each of the divided blocks.
  • the total number of input pixels is larger than the number of pixels for one frame. Therefore, the total input number of pixels is the sum of the number of different pixels included in all the blocks used by the image processing module 2602 to perform image processing.
  • the current number of input pixels is the number of all pixels input to the image processing module 2602 so far.
  • the current number of input pixels is the number of pixels included in each block for which image processing has been completed at the current point in each block divided by the image processing module 2602.
  • the current number of input pixels is the sum of the number of different pixels included in each block for which image processing has been completed.
  • the read / write switching control unit 2614 sets the urgency threshold by the above equations (6) to (8), above equation (14), above equation (13), and above equation (10) to above equation (11). calculate.
  • the above equations (6) to (8), the above equation (14), the above equation (13), and the above equation (10) to above equation The relationship between the respective times (values) calculated in 11) can be considered in the same manner as the relationship shown in FIG. 9 in the second calculation method.
  • the processing speed used in the above equation (13) for the read / write switching control unit 2614 to calculate the urgency threshold in the fourth calculation method the total number of input pixels used in the above equation (14), and the current number of input pixels
  • Each of the parameters is set by the CPU 220 in the register of the read / write switching control unit 2614 as a parameter used to calculate the urgency level threshold.
  • the speed, the total number of output pixels, the request processing time, the loss time coefficient, and the current elapsed time are also set in the register of the read / write switching control unit 2614 by the CPU 220 as parameters used to calculate the emergency threshold. ing.
  • the image processing module 2602 may be configured to sequentially set or notify the read / write switching control unit 2614.
  • the image processing module 2602 performs read / write switching control on the remaining number of input pixels used in equation (13) instead of the total number of input pixels used in equation (14) and the current number of input pixels. It may be configured to sequentially set or notify the unit 2614.
  • the image processing module 2602 controls the read / write switching control unit 2614. It may be configured to set or notify to Also, for example, when a component that monitors the state (for example, progress) of the image processing being executed by the image processing module 2602 is provided inside or outside the image processing unit 261, this component Based on the monitored image processing state, the read / write switching control unit 2614 can use the total number of input pixels and the current number of input pixels used in the above equation (14), and the current elapsed time used in the above equation (10). It may be configured to sequentially set or notify.
  • the component that monitors the state (for example, progress etc.) of the image processing being executed by the image processing module 2602 is in place of the total number of input pixels and the current number of input pixels used in equation (14).
  • the remaining number of input pixels used in the above equation (13) may be sequentially set or notified to the read / write switching control unit 2614.
  • the read / write switching control unit 2614 calculates the emergency degree threshold value by the calculation method as described in the first to fourth calculation methods. Then, the read / write switching control unit 2614 determines the degree of urgency of each DMA transfer (read DMA transfer and write DMA transfer) using the calculated urgency threshold and expresses the degree of urgency of each DMA transfer.
  • the signal UR is output to the bus arbiter 231. More specifically, the read / write switching control unit 2614 sets the urgency signal UR indicating that the DMA transfer urgency is low when the calculated DMA transfer waiting time is not longer than the urgency threshold. It outputs to the bus arbiter 231. Further, the read / write switching control unit 2614 outputs, to the bus arbiter 231, the urgency level signal UR indicating that the DMA transfer urgency is high when the calculated waiting time of each DMA transfer is longer than the urgency threshold. .
  • the bus arbiter 231 arbitrates the access request to the DRAM 30 from each processing block in accordance with the urgency level signal UR output from the read / write switching control unit 2614.
  • the bus arbiter 231 is notified by the read / write switching signal RW output from the read / write switching control unit 2614 when determining the image processing unit 261 as a processing block for accepting (permitting) an access request to the DRAM 30 Accept (permit) access requests for DMA transfer.
  • the operation of the bus arbiter 231 arbitrating an access request to the DRAM 30 based on the urgency level signal UR, that is, the priority of DMA transfer, can be easily considered based on the technology of the existing bus arbiter (so-called DMA arbitration circuit). be able to. Therefore, the detailed description of the operation of the bus arbiter 231 performing the arbitration for giving priority to any DMA transfer between the read DMA transfer by the bus master 2611 and the write DMA transfer by the bus master 2613 in accordance with the urgency level signal UR will be omitted.
  • the bus arbiter 231 determines that the image processing unit 261 is a processing block for accepting (permitting) the access request to the DRAM 30, the access request for read DMA transfer output from the bus master 2611 or the output request from the bus master 2613
  • the operation of accepting (permitting) any of the write DMA transfer access requests is the same as that of the bus arbiter 230 that configures the memory access device of the first embodiment. Therefore, the timing for performing DMA transfer in the memory access device of the second embodiment is the same as the timing for performing DMA transfer in the memory access device of the first embodiment described with reference to FIGS. 4 and 5. Therefore, details about the timing of performing DMA transfer in the memory access device of the second embodiment, that is, the operation of switching DMA transfer based on the first switching threshold and the operation of switching DMA transfer based on the second switching threshold Description is omitted.
  • the memory access device of the second embodiment also performs bi-directional (write and read) DMA transfer with the DRAM 30 as in the memory access device of the first embodiment.
  • the read / write switching control unit 2614 observes the state of the read DMA transfer by the bus master 2611 and the state of the write DMA transfer by the bus master 2613.
  • the read / write switching signal for causing the read / write switching control unit 2614 to notify the DMA transfer to be prioritized.
  • the RW is output to the bus arbiter 231.
  • the read / write switching control unit 2614 provides a certain allowance for the storage capacities of the read buffer 2611R and the write buffer 2613W. In the unoccupied state, the read / write switching signal RW is changed. Also in the memory access device of the second embodiment, as in the memory access device of the first embodiment, the bus arbiter 231 generates an access request for read DMA transfer from the bus master 2611 or write DMA transfer from the bus master 2613. When the access request is accepted (permitted), the DMA transfer access request notified by the read / write switching signal RW is accepted (permitted).
  • the read / write switching control unit 2614 is based on the parameters related to the image processing performed by the image processing module 2602 and the DMA transfer statuses of the observed bus master 2611 and bus master 2613.
  • the urgency level of the DMA transfer is determined, and the urgency level signal UR for notifying the urgency level is output to the bus arbiter 231.
  • the bus arbiter 231 when the bus arbiter 231 arbitrates the access request from each processing block, the bus arbiter 231 receives the access request from the image processing unit 261 in response to the urgency level signal UR ( Arbitrate with high priority.
  • the bus arbiter 231 when the urgency of the image processing executed by the image processing unit 261 becomes high, the bus arbiter 231 generates the bus master 2611 or the bus master based on the read / write switching signal RW.
  • the access request from 2613 can be preferentially received (permitted).
  • the transfer efficiency of image data on the data bus 210 which can be a factor causing the system failure, is reduced.
  • the image processing module 2602 that performs processing on image data transferred between the memory access device of the second embodiment and the DRAM 30 can smoothly perform a series of image processing.
  • the bus master includes at least a read buffer (read buffer 2611R), and a read bus master (bus master 2611) that outputs a read access request (DMA transfer for read access: read DMA transfer);
  • a memory access device memory access device including a buffer (write buffer 2613 W) and a write bus master (bus master 2613) for outputting a write access request (write transfer DMA transfer: write DMA transfer) is configured Ru.
  • the read / write switching control unit uses the setting regarding processing (image processing) performed by the processing module (image processing module 2602) set in advance.
  • the urgency threshold for determining the urgency of the access request (read DMA transfer performed by the bus master 2611 and write DMA transfer performed by the bus master 2613) output by the bus master (the bus master 2611 or the bus master 2613) is calculated and observed.
  • the bus arbiter 231 outputs an urgency signal (urgency signal UR) for notifying that the urgency level is high when it is longer than the urgency threshold and low when it is not longer than the urgency threshold.
  • An access request (DMA transfer) output from the bus master (the bus master 2611 or the bus master 2613) notified that the urgency level is high by the urgency level signal when arbitrating the access request (DMA transfer) to the memory (DRAM 30)
  • a memory access device is configured to perform arbitration by raising the priority of
  • the urgent degree threshold is defined to the DRAM 30 by the bus master (the bus master 2611 or the bus master 2613) which defines that a state in which the process (image process) performed by the image processing module 2602 does not wait
  • the bus master the bus master 2611 or the bus master 2613
  • the limit time set based on the time required to switch the state of the DRAM 30 (loss time of a predetermined (constant) time) to the limit time (limit time) until the end of the access (DMA transfer) of
  • a memory access device is configured which is a threshold of time multiplied by a ratio (loss time factor).
  • the urgency threshold includes the processing speed (processing speed) and the processing amount (total number of output pixels) in the image processing module 2602 and the processing performed by the image processing module 2602 (image processing) Ratio to the request processing time (loss time factor) set based on the request processing time required to complete the process and the time required to switch the state of the DRAM 30 (loss time of a predetermined (constant) time) And the amount of remaining processing in the image processing module 2602 (the number of remaining output pixels), and the processing time (current elapsed time) since the start of processing (image processing) by the image processing module 2602
  • a memory access device is configured, which is a threshold of time calculated based on the above.
  • the urgency threshold is divided into a plurality of processing (image processing) by the image processing module 2602 (preprocessed image data of the same number of pixels in one frame area is included)
  • the urgency threshold is divided into a plurality of times where the image processing module 2602 performs processing with different amounts of processing (dividing the area of one frame into a plurality of blocks to perform image processing) In the case where the number of pixels included in each block is different), the processing speed (processing speed) and amount of processing (total number of output pixels) in the image processing module 2602 and the processing performed by the image processing module 2602 ( A ratio (loss time) to the request processing time set based on the required processing time required to finish the image processing and the time required to switch the state of the DRAM 30 (loss time of a predetermined (constant) time) Coefficient), the amount of overall processing in the image processing module 2602 (total number of input pixels), and the amount of processing completed so far (current number of input pixels) Calculated based on the amount of remaining processing (number of remaining input pixels) determined from the above and the processing time (current elapsed time) since the start of processing (image processing) by the image processing module 2602 A memory access device is
  • the write switching control unit 2614 observes the status of DMA transfer in the bus master 2611 and the bus master 2613. Also in the memory access device according to the second embodiment, as in the memory access device according to the first embodiment, the read / write switching control unit 2614 performs read / write for notifying of the DMA transfer to be performed preferentially.
  • the switching signal RW is output to the bus arbiter 231 at an early timing.
  • the state of the DRAM 30 is appropriately switched, and the bus arbiter 231 accesses the bus master 2611 or the bus master 2613.
  • the request is accepted (permitted)
  • it is possible to accept (permit) the access request of the DMA transfer notified of by the read / write switching signal RW.
  • the loss time of the predetermined time (fixed time) necessary when switching the state of the DRAM 30 is more than necessary to reduce (decrease) the decrease in transfer efficiency of image data on the data bus 210, and to smoothly perform image processing by the image processing module 2602 and DMA transfer with the DRAM 30. Can.
  • the read / write switching control unit 2614 is based on the parameters related to the image processing performed by the image processing module 2602 and the DMA transfer statuses of the observed bus master 2611 and bus master 2613. Determine the urgency of the DMA transfer. Then, in the memory access device of the second embodiment, the urgency level signal UR for notifying the determined urgency of each DMA transfer is output to the bus arbiter 231.
  • the emergency output from the read / write switching control unit 2614 Arbitration can be performed with high priority for accepting (permitting) an access request from the image processing unit 261 in response to the degree signal UR.
  • the bus arbiter 231 when the urgency of the image processing performed by the image processing unit 261 becomes high, the bus arbiter 231 generates the bus master 2611 or the bus master 2611 based on the read / write switching signal RW. An access request from the bus master 2613 can be prioritized and accepted (permitted), and a series of image processing by the image processing module 2602 and DMA transfer with the DRAM 30 can be smoothly performed.
  • the transfer efficiency of image data on the data bus 210 which can be a factor causing the system failure, is reduced.
  • the image processing module 2602 that performs processing on image data transferred between the memory access device of the second embodiment and the DRAM 30 can smoothly perform a series of image processing.
  • the memory access apparatus includes a plurality of bus masters including the bus master 2611 and the bus master 2613, DMA transfer with the DRAM 30 is performed by DMA transfer in the access direction for reading (reading).
  • the configuration has been described in which one DMA transfer (write transfer) and one DMA transfer (write DMA transfer) in the access direction of write are performed.
  • the number of each in the bidirectional DMA transfer performed with the DRAM 30 is limited to the configuration shown in the memory access device of the second embodiment. Absent. That is, a memory access device may be configured to perform a plurality of DMA transfers in the read access direction and a plurality of DMA transfers in the write access direction.
  • a memory access device is configured to include a plurality of bus masters performing DMA transfer in the access direction of read access to the DRAM 30 and bus masters performing DMA transfer in the access direction of write access to the DRAM 30 It is also good.
  • the memory access device comprises, as bus masters constituting the memory access device, a plurality of bus masters that perform DMA transfer in the write access direction and a plurality of bus masters that perform DMA transfer in the read access direction. It is the composition provided. Also in the following description, when the memory access device according to the third embodiment of the present invention is included in an image processing device mounted in an imaging device such as a still image camera or a moving image camera, for example. Will be explained.
  • FIG. 10 is a block diagram showing a schematic configuration of an imaging apparatus equipped with an image processing apparatus provided with a memory access apparatus according to a third embodiment of the present invention. Note that FIG. 10 shows only components directly related to the memory access device of the third embodiment in the imaging device equipped with the image processing device including the memory access device of the third embodiment. That is, FIG. 10 shows only a part of the components of the image processing apparatus provided with the memory access device of the third embodiment.
  • the configuration of the image processing apparatus having the memory access device of the third embodiment shown in FIG. 10 is the same as the configuration of the image processing unit 261 having the memory access device of the second embodiment shown in FIG. Contains elements. Therefore, in the components of the image processing apparatus including the memory access device of the third embodiment, the same components as the components of the image processing unit 261 including the memory access device of the second embodiment are the same. And the detailed description of each component is omitted.
  • the memory access device of the second embodiment shown in FIG. 6 can be used for the configuration of the imaging device equipped with the image processing device provided with the memory access device of the third embodiment.
  • an imaging device 3 an imaging device equipped with an image processing device provided with the memory access device of the third embodiment is referred to as “imaging device 3”.
  • the image processing apparatus 22 shown in FIG. 10 includes a CPU 220, a bus arbiter 231, a DRAM interface unit 240 (not shown), a preprocessing unit 250 (not shown), an image processing unit 262, and a display processing unit 270 (not shown).
  • the image processing unit 262 includes three bus masters 2611-1 to 2611-3, four image processing modules 2602-1 to image processing modules 2602-4, two bus masters 2613-1 and bus master 2613-2. , Read / write switching control unit 2614.
  • the bus master 2611-1 also includes a read buffer 2611R-1.
  • the bus master 2611-2 further includes a read buffer 2611R-2.
  • the bus master 2611-3 includes a read buffer 2611R-3.
  • the bus master 2613-1 has a write buffer 2613W-1.
  • the bus master 2613-2 also includes a write buffer 2613W-2.
  • the bus arbiter 231, the preprocessing unit 250 (not shown), the image processing unit 262, and the display processing unit 270 (not shown) are connected to the common data bus 210.
  • the configuration of 2614 and the bus arbiter 231 corresponds to the memory access device of the third embodiment.
  • bus master 2611 when the three bus masters 2611-1 to 2611-3 are not distinguished from one another, they are simply referred to as “bus master 2611”.
  • bus master 2613 When the two bus masters 2613-1 and 2613-2 are not distinguished from one another, they are simply referred to as “bus master 2613”.
  • image processing module 2602 when the four image processing modules 2602-1 to 2602-4 are not distinguished from one another, they are simply referred to as "image processing module 2602".
  • the image processing apparatus 22 performs predetermined image processing on pixel signals output from the image sensor 10 (not shown), and is in a still state. Generate images and videos. Further, the image processing device 22 generates a display image according to the generated still image or moving image, as in the image processing device 21 in the second embodiment, and the generated display image is displayed on the display device 40 (not shown). Display. Further, the image processing device 22 generates a recording image according to the generated still image or moving image as in the image processing device 21 in the second embodiment, and records the generated recording image on a recording medium (not shown). You can also
  • each of the unillustrated preprocessing unit 250, the image processing unit 262, and the unillustrated display processing unit 270 is an image processing apparatus. 22 is a processing block for realizing the processing function of image processing to be executed in S.22.
  • each of the preprocessing unit 250, the image processing unit 262, and the display processing unit 270 passes through the data bus 210 as in the image processing apparatus 21 according to the second embodiment.
  • the DRAM 30 is accessed by the DMA transfer.
  • the image processing unit 262 performs predetermined image processing on preprocessed image data stored in the DRAM 30. It is a processing block to apply.
  • the image processing unit 262 also performs DMA transfer (read DMA transfer) for acquiring (reading) preprocessed image data to be subjected to image processing, and stores (writes) image data generated by image processing to the DRAM 30.
  • DMA transfer write DMA transfer
  • the image processing unit 262 includes the three bus masters 2611-1 to 2611-3, the four image processing modules 2602-1 to the image processing modules 2602-4, and the two bus masters 2613-1 and 2613. And a read / write switching control unit 2614.
  • Each of the bus masters 2611-1 to 2611-3 is a bus master 2611 provided in the image processing unit 262 in the image processing apparatus 21 according to the second embodiment shown in FIG.
  • Each of the bus master 2611-1 to the bus master 2611-3 acquires (reads) image data to be subjected to image processing by the corresponding image processing module 2602 from the DRAM 30 by read DMA transfer, and the corresponding image processing module 2602 Output to The image data that each of the bus masters 2611-1 to 2611-3 acquires (reads) from the DRAM 30 by read DMA transfer is not limited to preprocessed image data.
  • the bus master 2611-1 includes the read buffer 2611R-1.
  • the bus master 2611-2 further includes a read buffer 2611R-2.
  • the bus master 2611-3 includes a read buffer 2611R-3.
  • Each of the bus masters 2611-1 to 2611-3 temporarily stores (stores) the image data acquired (read) from the DRAM 30 by read DMA transfer in the corresponding read buffer 2611R. Then, each of the bus masters 2611-1 to 2611-3 stores (saves) image data of a predetermined data amount, and in response to a request from the corresponding image processing module 2602, that is, corresponding image processing The image data stored (stored) is output to the corresponding image processing module 2602 at the timing when the module 2602 performs image processing.
  • Each of the read buffer 2611R-1 to the read buffer 2611R-3 temporarily stores the image data of a predetermined data amount (for example, the number of pixels) that the corresponding bus master 2611 acquires (reads) from the DRAM 30 by read DMA transfer.
  • the read buffer 2611 R is provided in the bus master 2611 that constitutes the memory access device of the second embodiment shown in FIG.
  • Each of the bus master 2613-1 and the bus master 2613-2 is a bus master 2613 provided in the image processing unit 262 in the image processing apparatus 21 in the second embodiment shown in FIG.
  • Each of the bus masters 2613-1 and 2613-2 stores (writes) the image data after image processing by the corresponding image processing module 2602 in the DRAM 30 by write DMA transfer.
  • the image data stored (written) in the DRAM 30 by write DMA transfer by each of the bus master 2613-1 and the bus master 2613-2 is not limited to image-processed image data (still image data or moving image data).
  • the bus master 2613-1 includes the write buffer 2613W-1.
  • the bus master 2613-2 also includes a write buffer 2613W-2.
  • Each of the bus masters 2613-1 and 2613-2 temporarily stores (stores) image data generated by the corresponding image processing module 2602 performing image processing in the corresponding write buffer 2613 W. Then, each of the bus master 2613-1 and the bus master 2613-2 stores (saves) the image data of a predetermined data amount, and then stores (saves) the image data in accordance with the DMA transfer timing. The data is output to the bus arbiter 231 and stored (written) in the DRAM 30.
  • Each of the write buffer 2613W-1 and the write buffer 2613W-2 temporarily stores image data of a predetermined data amount (for example, the number of pixels) that the corresponding bus master 2613 causes the corresponding bus master 2613 to store (write) in the DRAM 30 by write DMA transfer.
  • the write buffer 2613 W is provided in the bus master 2613 which constitutes the memory access device of the second embodiment shown in FIG.
  • the read / write switching control unit 2614 is a read / write switching control unit 2614 that configures the memory access device of the second embodiment shown in FIG. However, in the memory access device according to the third embodiment, the read / write switching control unit 2614 performs the read DMA transfer state performed by each of the bus master 2611-1 to the bus master 2611-3, the bus master 2613-1, and the bus master 2613-2. And observe the state of the write DMA transfer performed by each. Then, the read / write switching control unit 2614 reads / writes the DMA transfer for which the bus arbiter 231 wants to receive (permit) an access request based on the observed status of DMA transfer between the respective bus masters 2611 and the respective bus masters 2613. It notifies by the switching signal RW.
  • the read / write switching control unit 2614 requests the read access that each of the bus masters 2611 acquires (reads) the image data from the DRAM 30, accepts (permits) the read access request, and the read buffer 2611R
  • the state of the read DMA transfer by each of the bus masters 2611 is observed by observing each of the data amount of the image data stored (stored) in each.
  • the image processing unit 262 shown in FIG. 10 observes the request and acceptance (permission) of read access by the bus master 2611-1 by the read access observation signal RA-1, and the read buffer 2611 R-1 by the read buffer observation signal RB-1. The amount of image data stored in is observed. Further, the image processing unit 262 shown in FIG.
  • the image processing unit 262 shown in FIG. 10 observes the request and acceptance (permission) of read access by the bus master 2611-2 by the read access observation signal RA-2, and the read buffer 2611R by the read buffer observation signal RB-2. The amount of image data stored in -2 is observed. Further, the image processing unit 262 shown in FIG. 10 observes the request and acceptance (permission) of read access by the bus master 2611-3 by the read access observation signal RA-3, and the read buffer 2611R by the read buffer observation signal RB-3. The amount of image data stored in -3 is observed.
  • each of the read access observation signal RA-1 to the read access observation signal RA-3 is an access request signal (DMA request signal) for the corresponding bus master 2611 to request a read access, and the bus arbiter 231 is for each read access.
  • each of the read buffer observation signal RB-1 to the read buffer observation signal RB-3 is a signal indicating whether or not image data is stored (stored) in all the storage capacities of the corresponding read buffer 2611R, It is a signal indicating whether image data is stored (stored) in a storage capacity larger than a predetermined ratio in the read buffer 2611R.
  • the read / write switching control unit 2614 stores the write access request that each of the bus masters 2613 stores (writes) the image data in the DRAM 30, acceptance (permission) of the write access request, and storage in each of the write buffers 2613W ( The state of write DMA transfer by each of the bus masters 2613 is observed by observing each of the stored image data and the amount of image data.
  • the image processing unit 262 shown in FIG. 10 observes the write access request and acceptance (permission) by the bus master 2613-1 by the write access observation signal WA-1, and the write buffer 2613W-1 by the write buffer observation signal WB-1. The amount of image data stored in is observed. Further, the image processing unit 262 shown in FIG.
  • each of the write access observation signal WA-1 to the write access observation signal WA-2 is an access request signal (DMA request signal) for the corresponding bus master 2613 to request a write access
  • the bus arbiter 231 is for each write access.
  • each of the write buffer observation signal WB-1 to the write buffer observation signal WB-2 is a signal indicating whether or not the image data is stored (stored) in all the storage capacities of the corresponding write buffer 2613W. It is a signal indicating whether image data is stored (stored) in a storage capacity larger than a predetermined ratio in the write buffer 2613 W.
  • the read / write switching control unit 2614 prioritizes which DMA transfer of the read DMA transfer by each bus master 2611 and the write DMA transfer by each bus master 2613 is to be performed based on the observed status of each DMA transfer Determine At this time, the read / write switching control unit 2614 also summarized the DMA transfer state shown in FIG. Make a judgment based on the table. At this time, in the memory access device of the third embodiment, the read / write switching control unit 2614 considers the bus master 2611-1 to the bus master 2611-3 as one bus master 2611, and the bus master 2613-1 and the bus master 2613-2 are It judges as one bus master 2613 and makes a determination.
  • the read / write switching control unit 2614 performs image processing corresponding to any one of the read buffer 2611R-1 to the read buffer 2611R-3 and performs image processing. If it can not be observed that image data having a sufficient amount of data to perform (1) is stored (saved), it is determined that the item "read buffer” in FIG. 3 is "empty". On the other hand, the read / write switching control unit 2614 stores (saves) image data having an amount of data sufficient for the image processing module 2602 to perform image processing in all of the read buffer 2611R-1 to read buffer 2611R-3. If it is observed that the "Read buffer” item in FIG. 3 is "full” is determined.
  • the read / write switching control unit 2614 is sufficient for storing (writing) in the DRAM 30 by write DMA transfer to either the bus master 2613-1 or the bus master 2613-2.
  • image data of an appropriate amount of data is stored (saved)
  • image data having a data amount sufficient for the read / write switching control unit 2614 to store (write) in the DRAM 30 by write DMA transfer is stored (saved) in all the bus masters 2613-1 and 2613-2. If it can not be observed, it is determined that the item of "write buffer” in FIG. 3 is "empty".
  • the read / write switching control unit 2614 outputs an access request for read DMA transfer as the observed DMA transfer state, and one of the read buffer 2611R-1 to the read buffer 2611R-3 and the bus master 2613-1
  • the corresponding image processing module 2602 performs the image processing while the bus master 2611 is waiting to receive (permit) an access request for read DMA transfer. It determines that it has stopped.
  • the read / write switching control unit 2614 outputs an access request for write DMA transfer as the observed DMA transfer state, and either the bus master 2613-1 or the bus master 2613-2 and the read buffer 2611R-1 to the read buffer
  • the corresponding image processing module 2602 stops the image processing while the bus master 2613 is waiting to receive (permit) an access request for write DMA transfer. It is determined that there is.
  • the read / write switching control unit 2614 outputs the read / write switching signal RW generated based on the determination result to the bus arbiter 231, whereby DMA transfer that is desired to be prioritized, ie, acceptance of an access request by the bus arbiter 231 ( Notify DMA transfer that you want to be permitted.
  • the bus arbiter 231 receives (permits) an access request from the image processing unit 262
  • each bus master 2611 acquires (reads) image data from the DRAM 30 based on the read / write switching signal RW.
  • An access request for DMA transfer of either one of transfer and write DMA transfer for causing each of the bus masters 2613 to store (write) image data in the DRAM 30 is accepted (permitted).
  • the determination for the read / write switching control unit 2614 to notify the urgent degree of DMA transfer between the bus master 2611 and the bus master 2613 is the memory access device of the second embodiment.
  • the read / write switching control unit 2614 is similar to the determination for notifying the urgency of each DMA transfer. That is, the read / write switching control unit 2614 determines the degree of urgency separately for the read DMA transfer by each bus master 2611 and the write DMA transfer by each bus master 2613. Then, the bus arbiter 231 outputs to the bus arbiter 231 the urgency level signal UR, which is generated based on the determination result, for notifying the urgency of each DMA transfer.
  • the bus arbiter 231 arbitrates the access request from each processing block in the image processing apparatus 22 connected to the data bus 210, the access from the image processing unit 262 is performed according to the urgency level signal UR. Arbitration is performed with high priority for accepting (permitting) requests.
  • FIG. 11 is a timing chart showing an example of the timing for performing DMA transfer in the memory access apparatus of the third embodiment of the present invention.
  • the read buffer 2611R provided in the bus master 2611 is similar to one example of the timing chart of the operation of switching the DMA transfer based on the first switching threshold in the memory access device of the first embodiment shown in FIG. And an example of the timing of the operation of switching the DMA transfer by the transition of the amount of data stored (stored) in each of the write buffer 2613 W provided in the bus master 2613 and the write buffer 2613 W. More specifically, the read buffer 2611R-1 provided in the bus master 2611-1, the read buffer 2611R-2 provided in the bus master 2611-2, the read buffer 2611R-3 provided in the bus master 2611-3, and the bus master 2613-1.
  • This figure shows an example of the timing of the operation of switching the DMA transfer in the transition of the amount of data stored (stored) in each of the write buffer 2613W-1 provided and the write buffer 2613W-2 provided in the bus master 2613-2.
  • the read buffer 2611 R and the write buffer are similar to one example of the timing chart of the operation of switching the DMA transfer based on the first switching threshold in the memory access device of the first embodiment shown in FIG. 26 shows the transition of the amount of data when each configuration with 2613 W is a double buffer configuration.
  • the read / write switching control unit 2614 is similar to one example of the timing chart of the operation of switching the DMA transfer based on the first switching threshold in the memory access device of the first embodiment shown in FIG. Shows an example of the timing of the read / write switching signal RW output to the bus arbiter 231 and the timing of DMA transfer accepted (permitted) by the bus arbiter 231. Also in FIG. 11, the level indicated by the read / write switching signal RW and the timing of DMA transfer are switched based on the first switching threshold in the memory access device of the first embodiment shown in FIG. This is the same as an example of the operation timing chart.
  • FIG. 11 shows an example of the timing of the urgency level signal UR that the read / write switching control unit 2614 outputs to the bus arbiter 231. Note that, in FIG. 11, the urgency level signal UR output from the read / write switching control unit 2614 indicates that the urgency level is high at the “High” level, and indicates that the urgency level is low at the “Low” level.
  • each of the bus master 2611-1, bus master 2611-2, and bus master 2611-3 first performs read DMA transfer on the image data to be subjected to image processing. Acquire (read) from the DRAM 30. Therefore, the read / write switching control unit 2614 outputs, to the bus arbiter 231, the “High” level read / write switching signal RW notifying that priority is given to the read DMA transfer. Further, the read / write switching control unit 2614 outputs the “Low” level of the urgency level signal UR indicating that the urgency level is low to the bus arbiter 231.
  • the bus arbiter 231 determines that the image processing unit 262 is a processing block for accepting (permitting) the access request to the DRAM 30, the bus master 2611-1, the bus master 2611-2, and the bus master 2611-3 respectively. Are sequentially accepted (permitted).
  • the read buffer 2611R-1, the read buffer 2611R-2, and the read buffer 2611R-3 sequentially store (save) the image data acquired (read) from the DRAM 30.
  • each of the image processing modules 2602 is stored (stored) in the corresponding read buffer 2611R.
  • the image data can be read out and image processing can be performed.
  • each of the bus masters 2611 outputs the image data stored (stored) in the corresponding read buffer 2611 R in accordance with the timing at which the corresponding image processing module 2602 performs image processing.
  • the data amount of the image data stored (stored) in each read buffer 2611 R is reduced by the amount output to the corresponding image processing module 2602.
  • each image processing module 2602 outputs image processing image data generated by performing image processing on the image data output from the corresponding bus master 2611 or 2613 to the corresponding bus master 2611 or 2613.
  • the bus master 2613-1 performs image processing on the image data acquired by the image processing module 2602-3 from the corresponding read buffer 2611R-3.
  • the write buffer 2613W-1 sequentially stored (saved) in the write buffer 2613W-1. Therefore, in the example of the timing chart shown in FIG. 11, the data amount of the image data stored (stored) in the write buffer 2613W-1 increases from the timing t1.
  • the image processing module 2602-4 acquires the image data output by the image processing module 2602-3 through the bus master 2613-1, performs further image processing, and executes the image processing. It shows a case where the processed image data is output to the bus master 2613-2 and sequentially stored (saved) in the write buffer 2613W-2. Therefore, the amount of image data to be stored (stored) increases in the write buffer 2613W-2 with a delay by the delay time (processing delay time) of the image processing performed by the image processing module 2602-4 from the timing t1. To go.
  • the read / write switching control unit 2614 observes the data amount of the image data stored (stored) in the read buffer 2611R and the write buffer 2613W.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at timing t2 is equal to or greater than the first write switching threshold.
  • the data amount of the image data stored (stored) in the read buffer 2611R-1 at timing t2 is equal to or less than the first read switching threshold value. Therefore, the read / write switching control unit 2614 can change the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “High” level notifying that priority is given to the read DMA transfer at timing t2.
  • the bus arbiter 231 determines that the image processing unit 262 is a processing block for accepting (permitting) the access request to the DRAM 30
  • the bus arbiter 231 accepts (permits the access request for read DMA transfer output from the bus master 2611-1. ), Maintain the current state of the DRAM 30.
  • the bus master 2611-1 starts read DMA transfer immediately from timing t3 when the data amount of the image data stored (stored) in the read buffer 2611R-1 becomes the image processing startable data amount. be able to.
  • the read / write switching control unit 2614 uses the read / write switching signal RW to preferentially perform DMA transfer for read DMA transfer and write.
  • the read / write switching control unit 2614 notifies that the read / write switching signal RW is prioritized for the read DMA transfer. I'm leaving.
  • the method of causing the read / write switching control unit 2614 to maintain the current state of the DRAM 30 is not limited to the method of not changing the state of the read / write switching signal RW as described above.
  • the bus arbiter 231 by configuring the read / write switching control unit 2614 to output a signal indicating whether the read / write switching signal RW is valid or invalid together with the read / write switching signal RW, the bus arbiter 231 generates an image processing unit.
  • the invalid read / write switching signal RW may not be referred to.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 at timing t3 is equal to or more than the first write switching threshold. Therefore, even at timing t3, the read / write switching control unit 2614 changes the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer. can do.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “High” level notifying that priority is given to the read DMA transfer even at timing t3. ing. Then, in the example of the timing chart shown in FIG.
  • the bus master 2611-2 must immediately start read DMA transfer from the timing when the data amount of the image data stored (stored) in the read buffer 2611R-2 becomes the image processing startable data amount. Can.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 at the timing t5 when the bus master 2611-2 ends the read DMA transfer is It is less than the lead switching threshold of 1.
  • the read / write switching control unit 2614 notifies the read / write switching signal RW that priority is given to the read DMA transfer even at the timing t5. I'm leaving. Therefore, the bus master 2611-3 must immediately start read DMA transfer from the timing when the data amount of the image data stored (stored) in the read buffer 2611R-3 becomes the image processing startable data amount. Can.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 is “full” after timing t5. That is, there is no space in the storage capacity for storing (saving) the image data output from the image processing module 2602-3 in the write buffer 2613W-1. Therefore, the image processing module 2602-3 waits for the image data after image processing to be stored (saved) in the write buffer 2613W-1 of the corresponding bus master 2613-1. Image processing is stopped in the off state. Therefore, the read / write switching control unit 2614 determines that the urgency of the write DMA transfer by the bus master 2613-1 is high.
  • the read / write switching control unit 2614 gives priority to the write DMA transfer with the read / write switching signal RW.
  • the "Low” level to be notified is set, and the urgency level signal UR is set to "High” level indicating that the urgency level is high. Therefore, the bus master 2613-1 can start the write DMA transfer after the bus master 2611-3 completes the read DMA transfer.
  • the bus master 2611-3 ends the read DMA transfer at timing t6.
  • the bus arbiter 231 determines that the image processing unit 262 is a processing block for accepting (permitting) the access request to the DRAM 30
  • the bus arbiter 231 accepts (permits the access request for write DMA transfer output from the bus master 2613-1.
  • the state of the DRAM 30 are switched from the state in which data is read to the state in which data is written.
  • the bus master 2613-1 stores the image data stored (saved) in the write buffer 2613W-1 by the write DMA transfer from the timing t7 at which the predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed. Are stored (written) in the DRAM 30.
  • the read buffer 2611R-3 of the bus master 2611-3 which has finished the read DMA transfer at the timing t6 has the data amount of the stored (saved) image data in the "full" state.
  • the corresponding image processing module 2602-3 can store (save) the image data after image processing in the write buffer 2613W-1 of the corresponding bus master 2613-1. This is because acquisition of image data stored (stored) in the read buffer 2611R-3 is not performed (read) by the image processing module 2602-3 because the image processing is stopped in the waiting state.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 corresponds to the fact that the storage capacity of the write buffer 2613W-1 becomes vacant as the bus master 2613-1 starts the write DMA transfer.
  • the number decreases by the amount acquired (read) by the image processing module 2602-3.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 at the timing t6 is "full". That is, also in the write buffer 2613W-2, there is no space in the storage capacity for storing (saving) the image data output by the image processing module 2602-4. Therefore, the image processing module 2602-4 also waits for the image data after image processing to be stored (saved) in the write buffer 2613W-2 of the corresponding bus master 2613-2. Image processing is stopped in the off state. Therefore, the read / write switching control unit 2614 determines that the urgency of the write DMA transfer by the bus master 2613-2 is high. Therefore, even at timing t7 when the bus master 2613-1 starts the write DMA transfer, the read / write switching control unit 2614 keeps the urgency level signal UR at the "High" level, which indicates that the urgency is high.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at the timing t8 is equal to or more than the first write switching threshold.
  • the bus master 2613-1 ends the write DMA transfer at the timing t8. Therefore, at timing t8, the read / write switching control unit 2614 changes the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer. be able to.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer at timing t8.
  • the urgency signal UR remains at the “High” level, which indicates that the urgency is high.
  • the bus arbiter 231 accepts (permits an access request for write DMA transfer output from the bus master 2613-2. ), Maintain the current state of the DRAM 30.
  • the bus master 2613-2 can start the write DMA transfer immediately from timing t8.
  • the read / write switching control unit 2614 sets the urgency level signal UR to "Low” indicating that the urgency level is low. I'm on the level.
  • the bus master 2613-1 can immediately start the write DMA transfer from the timing when the image data is stored (saved) in the write buffer 2613W-1 up to the DMA transfer startable data amount.
  • the bus master 2613-2 ends the write DMA transfer at timing t10.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at the timing t10 is the DMA transfer startable data amount.
  • the data amount of the image data stored (stored) in the read buffer 2611R-2 at timing t10 is equal to or less than the first read switching threshold value. Therefore, even at timing t10, the read / write switching control unit 2614 changes the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer. can do.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer even at timing t10. ing. Therefore, from timing t10, the bus master 2613-1 causes the DRAM 30 to store (write) the image data stored (stored) in the write buffer 2613W-1 by write DMA transfer.
  • the bus master 2613-1 ends the write DMA transfer at the timing t11.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 at the timing t11 is equal to or more than the first write switching threshold. Therefore, the bus master 2613-2 can immediately start the write DMA transfer from the timing when the image data is stored (saved) in the write buffer 2613W-2 up to the DMA transfer startable data amount.
  • the bus master 2613-2 ends the write DMA transfer at the timing t12.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at the timing t12 is the DMA transfer startable data amount.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 at timing t12 is equal to or less than the first read switching threshold value. Therefore, even at timing t12, the read / write switching control unit 2614 changes the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer. can do.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer even at timing t12. ing. Therefore, the bus master 2613-1 can immediately start the write DMA transfer from the timing when the image data is stored (saved) in the write buffer 2613W-1 up to the DMA transfer startable data amount.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer, similarly after timing t12. ing. Therefore, each of the bus masters 2613-1 and 2613-2 performs write DMA transfer to the write buffer 2613 W each time image data is stored (saved) in the write buffer 2613 W up to the DMA transfer startable data amount. The stored (saved) image data is stored (written) in the DRAM 30.
  • the example of the timing chart shown in FIG. 11 shows timings at which the bus master 2613-1 performs write DMA transfer in respective periods of timing t13 to timing t14, timing t17 to timing t18, and timing t21 to timing t22. There is. Further, in the example of the timing chart shown in FIG. 11, the data amount of the image data stored (stored) in the write buffer 2613W-1 is equal to or greater than the first write switching threshold at timing t16 and timing t20. It shows the timing of becoming. Further, in the example of the timing chart shown in FIG.
  • the data amount of the image data stored (stored) in the read buffer 2611R-1 at the timing t16 is in the “empty” state. That is, the image data stored (stored) in the read buffer 2611R-1 is empty, and the image processing module 2602-1 can not output the image data to be subjected to the image processing. For this reason, the image processing module 2602-1 stops the image processing while waiting for the image data necessary for performing the image processing to be aligned with the read buffer 2611R-1 of the corresponding bus master 2611-1. It can be considered. However, the amount of image data stored (stored) in the read buffer 2611R-1 at timing t16 in the example of the timing chart shown in FIG.
  • the read / write switching control unit 2614 determines that the urgency of read DMA transfer by the bus master 2611-1 is low, and notifies the read / write switch signal RW that priority is given to write DMA transfer. It is left, and the urgency signal UR is kept at the “Low” level which indicates that the urgency is low.
  • the bus arbiter 231 maintains the current state of the DRAM 30, and when determining the image processing unit 262 as a processing block for accepting (permitting) the access request to the DRAM 30, Accept (permit) the output request for write DMA transfer.
  • the data amount of the image data stored (stored) in the read buffer 2611R-1 at the timing t16 is "empty".
  • the information that the image processing for one block by the processing module 2602-1 is completed may be set by the CPU 220 in the register of the read / write switching control unit 2614, for example. Also, for example, the information that the image processing for one block by the image processing module 2602-1 is completed is sequentially given to the read / write switching control unit 2614 as the information indicating the current processing state. It may be configured to set or notify.
  • the data amount of the image data stored (stored) in the read buffer 2611R-2 at the timing t18 is "empty". Further, in the example of the timing chart shown in FIG. 11, the data amount of the image data stored (stored) in the read buffer 2611R-3 at the timing t21 is in the “empty” state. However, in the example of the timing chart shown in FIG. 11, the timing at which the data amount of the image data stored (stored) in the read buffer 2611R-2 at timing t18 is "empty" is the timing. This is because, for example, the image processing for one block by the image processing module 2602-2 is completed, as in the case of t16. Also, in the example of the timing chart shown in FIG.
  • the read / write switching control unit 2614 determines that the degree of urgency of the read DMA transfer by the bus master 2611-2 or the bus master 2611-3 is low, as in the timing t16, and the read / write switch signal RW The "Low” level is notified to give priority to transfer, and the urgency level signal UR is kept at “Low” level indicating that the urgency level is low.
  • the bus arbiter 231 maintains the current state of the DRAM 30 also at timing t18 and timing t21, and when determining the image processing unit 262 as a processing block for accepting (permitting) the access request to the DRAM 30, The access request for the write DMA transfer output from the bus master 2613-1 or the bus master 2613-2 is accepted (permitted).
  • the amount of image data stored (saved) in each read buffer 2611 R at timing t 18 and timing t 21 is in the “empty” state.
  • information that the image processing for one block is completed by the corresponding image processing module 2602 may also be set in the register of the read / write switching control unit 2614 by the CPU 220, for example.
  • information that image processing for one block by each image processing module 2602 is completed is a state of image processing executed by each image processing module 2602 or each image processing module 2602 (for example, progress, etc.
  • the component that monitors) may be configured to sequentially set or notify the read / write switching control unit 2614.
  • the read / write switching control unit 2614 gives priority to the read / DMA transfer prior to the read / write switching signal RW at timing t24 when the bus master 2613-2 ends the write DMA transfer. "High" level to notify you to do. Therefore, each of the bus masters 2611 can perform read DMA transfer.
  • the bus arbiter 231 accepts (permits) an access request for read DMA transfer output from each of the bus masters 2611 when determining the image processing unit 262 as a processing block for accepting (permitting) an access request to the DRAM 30.
  • the state of the DRAM 30 is switched from the state in which data is written to the state in which data is read. In the example of the timing chart shown in FIG.
  • the bus master 2611-1 and the bus master 2611-2 are in a period from timing t25 to timing t26 when a predetermined (constant) loss time necessary for switching the state of the DRAM 30 has elapsed.
  • the image data that each bus master 2611 acquires (reads) from the DRAM 30 by read DMA transfer in the period from timing t25 to timing t26 is, for example, the next bus master 2611 Image data to be subjected to image processing for image processing of a block.
  • FIG. 12 is a timing chart showing an example of another timing for performing DMA transfer in the memory access apparatus of the third embodiment of the present invention.
  • the read buffer 2611R provided in the bus master 2611 and the write buffer 2613W provided in the bus master 2613 are provided similarly to the example of the timing chart of the operation of switching DMA transfer based on the first switching threshold shown in FIG. 4 shows an example of the timing of the operation of switching the DMA transfer by transition of the amount of data stored (stored) in each of the above. Also in FIG. 12, similarly to the example of the timing chart shown in FIG. 11, the transition of the data amount is shown when each configuration of the read buffer 2611R and the write buffer 2613W is a double buffer configuration.
  • each of the bus master 2611-1, the bus master 2611-2, and the bus master 2611-3 starts with, as in the example of the timing chart shown in FIG.
  • the read DMA transfer acquires (reads) image data to be processed from the DRAM 30. Therefore, the read / write switching control unit 2614 outputs, to the bus arbiter 231, the “High” level read / write switching signal RW notifying that priority is given to the read DMA transfer. Further, the read / write switching control unit 2614 outputs the “Low” level of the urgency level signal UR indicating that the urgency level is low to the bus arbiter 231.
  • the read buffer 2611R-1, the read buffer 2611R-2, and the read buffer 2611R-2 each obtain (read) an image obtained from the DRAM 30. Data is sequentially stored (saved).
  • each of the image processing modules 2602 when the data amount of the image data stored (stored) in each read buffer 2611 R becomes equal to or more than the image processing startable data amount, each of the image processing modules 2602 is similar to the example of the timing chart shown in FIG.
  • the image data stored (saved) in the corresponding read buffer 2611 R can be read out to perform image processing.
  • each of the image processing modules 2602 performs image processing on image data output from the corresponding bus master 2611 or 2613 as in the example of the timing chart shown in FIG. , Output to the corresponding bus master 2611 or bus master 2613.
  • the delay of the image processing performed by the image processing module 2602-4 from the timing t1 to the write buffer 2613W-2 The amount of image data to be stored (stored) increases with a delay by time (processing delay time). Further, in the example of the timing chart shown in FIG. 12 as well as the example of the timing chart shown in FIG. 11, the data amount of the image data stored (saved) in each read buffer 2611 R corresponds to the corresponding image processing module It decreases by the output to 2602.
  • the read / write switching control unit 2614 observes the data amount of the image data stored (stored) in the read buffer 2611R and the write buffer 2613W.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at timing t2 is equal to or greater than the second write switching threshold. Therefore, at timing t2, the read / write switching control unit 2614 sets the read / write switching signal RW to the “low” level, which notifies that the write DMA transfer is prioritized.
  • the bus arbiter 231 determines that the image processing unit 262 is a processing block for accepting (permitting) the access request to the DRAM 30
  • the bus arbiter 231 accepts (permits the access request for write DMA transfer output from the bus master 2613-1.
  • the state of the DRAM 30 are switched from the state in which data is read to the state in which data is written.
  • the bus master 2613-1 stores the image data stored (saved) in the write buffer 2613W-1 by the write DMA transfer from the timing t3 at which the predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed. Are stored (written) in the DRAM 30.
  • the read / write switching control unit 2614 determines that the data amount of the image data stored (stored) in the write buffer 2613W is full based on the second write switching threshold, that is, the storage capacity of the write buffer 2613W. Changes the read / write switching signal RW at timing t2 before the state becomes full.
  • the image processing module 2602-3 reads the image data stored (stored) in the read buffer 2611R-3 and performs image processing after timing t2 as in the example of the timing chart shown in FIG. There is.
  • the bus master 2613-1 starts write DMA transfer, that is, it is stored in the write buffer 2613W-1 by the timing t3 when a loss time of a predetermined time (fixed time) necessary for switching in the DRAM 30 elapses. Amount of image data is full.
  • the bus master 2613-1 can start the write DMA transfer from timing t3 without waiting for the image data to be stored (saved) until the storage capacity of the write buffer 2613W-1 becomes full.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 is reduced by the amount stored (written) in the DRAM 30. To go.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 at timing t3 is equal to or larger than the second write switching threshold.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer even at timing t3. ing.
  • the bus arbiter 231 accepts (permits an access request for write DMA transfer output from the bus master 2613-2. ), Maintain the current state of the DRAM 30.
  • the bus master 2613-2 can start the write DMA transfer after the bus master 2613-1 completes the write DMA transfer.
  • the bus master 2613-1 ends the write DMA transfer at the timing t4.
  • the bus master 2613-2 can start read DMA transfer immediately from timing t4.
  • the data amount of the image data stored (stored) in the read buffer 2611R-1 at timing t5 is equal to or less than the second read switching threshold value. Therefore, the read / write switching control unit 2614 can change the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer. In the example of the timing chart shown in FIG. 12, at timing t5, the read / write switching control unit 2614 sets the read / write switching signal RW to the “High” level notifying that priority is given to the read DMA transfer. Therefore, the bus master 2611-1 can start read DMA transfer after the bus master 2613-2 completes write DMA transfer.
  • the bus master 2613-2 ends the write DMA transfer at timing t6.
  • the bus arbiter 231 accepts (permits an access request for read DMA transfer output from the bus master 2611-1.
  • the state of the DRAM 30 are switched from the state where data is written to the state where data is read.
  • the bus master 2611-1 acquires (reads) image data from the DRAM 30 by read DMA transfer from timing t7 at which a predetermined (constant) loss time necessary for switching the state of the DRAM 30 has elapsed, and reads buffer 2611R. Store (save) in -1.
  • the read / write switching control unit 2614 sets the image data stored (saved) in the read buffer 2611R-1 to an empty state based on the second read switching threshold, that is, stores the read buffer 2611R-1.
  • the read / write switching signal RW is changed at timing t5 before all the capacities become free.
  • the image data acquired (read) from the DRAM 30 is sequentially stored (saved) in the read buffer 2611R-1 from the timing t7, and the read buffer 2611R-1
  • the data amount of the image data stored (stored) in the read buffer 2611R-2 at timing t7 is equal to or less than the second read switching threshold value.
  • the read / write switching control unit 2614 keeps the read / write switching signal RW at the “High” level notifying that priority is given to the read DMA transfer at timing t7.
  • the bus arbiter 231 determines the image processing unit 262 as a processing block for accepting (permitting) the access request to the DRAM 30, the bus arbiter 231 accepts (permits the access request for read DMA transfer output from the bus master 2611-2 ), Maintain the current state of the DRAM 30.
  • the bus master 2611-2 can start the read DMA transfer after the bus master 2611-1 completes the read DMA transfer.
  • the bus master 2611-1 ends the read DMA transfer at timing t8.
  • the bus master 2611-2 can start read DMA transfer immediately from timing t8.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 is equal to or less than the second read switching threshold at the timing t8.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 at timing t8 is equal to or more than the second write switching threshold. Therefore, the read / write switching control unit 2614 can change the read / write switching signal RW to a state in which priority is given to either one of the read DMA transfer and the write DMA transfer.
  • the image data stored (stored) in the read buffer 2611R-3 is read and image processing is performed, and the image data after image processing is stored in the write buffer 2613W- of the bus master 2613-2.
  • the image processing module 2602-3 stored (saved) in 1 stops the image processing while waiting for the image data to be subjected to the image processing to be aligned with the read buffer 2611R-3. Furthermore, the image processing module 2602-3 stops the image processing while waiting for the image data after image processing to be stored (saved) in the write buffer 2613W-1. It will be.
  • the read / write switching control unit 2614 prioritizes based on the priority between the read DMA transfer performed by each of the bus masters 2611 and the write DMA transfer performed by each of the bus masters 2613 determined in advance by the image processing unit 262. And determine the DMA transfer to be performed.
  • the read DMA transfer performed by the bus master 2611-3 has higher priority than the write DMA transfer performed by the bus master 2613-1. Therefore, in the example of the timing chart shown in FIG. 12, at timing t8, the read / write switching control unit 2614 notifies that the read / write switching signal RW is prioritized for the read DMA transfer. I'm leaving.
  • the bus arbiter 231 determines the image processing unit 262 as a processing block for accepting (permitting) the access request to the DRAM 30, the bus arbiter 231 accepts (permits the access request for read DMA transfer output from the bus master 2611-2 ), Maintain the current state of the DRAM 30.
  • the bus master 2611-3 can start the read DMA transfer after the bus master 2611-2 completes the read DMA transfer.
  • the bus master 2611-2 ends the read DMA transfer at timing t9.
  • the bus master 2611-3 can start read DMA transfer immediately from timing t9.
  • the read / write switching control unit 2614 notifies that the read / write switching signal RW is given priority to the write DMA transfer. And sets the urgency level signal UR to "High" level, which indicates that the urgency level is high. Therefore, the bus master 2613-1 can start the write DMA transfer after the bus master 2611-3 completes the read DMA transfer. In the example of the timing chart shown in FIG. 12, the bus master 2611-3 ends the read DMA transfer at timing t10.
  • the bus arbiter 231 determines that the image processing unit 262 is a processing block for accepting (permitting) the access request to the DRAM 30
  • the bus arbiter 231 accepts (permits the access request for write DMA transfer output from the bus master 2613-1.
  • the state of the DRAM 30 are switched from the state in which data is read to the state in which data is written.
  • the bus master 2613-1 stores the image data stored (saved) in the write buffer 2613W-1 by the write DMA transfer from timing t11 at which a predetermined (fixed) loss time necessary for switching the state of the DRAM 30 has elapsed Are stored (written) in the DRAM 30.
  • the read buffer 2611R-3 of the bus master 2611-3 which has finished the read DMA transfer at the timing t10 has the data amount of the image data stored (stored) in the "full" state.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 is that the bus master 2613-1 starts write DMA transfer and the corresponding image processing module 2602-3 resumes image processing. It decreases by the amount acquired (read) by the image processing module 2602-3.
  • the data amount of the image data stored (stored) in the read buffer 2611R-3 becomes smaller than the timing t11 when the bus master 2613-1 starts the write DMA transfer. It shows.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 at the timing t9 is equal to or larger than the second write switching threshold. Then, in the example of the timing chart shown in FIG. 12, when the bus master 2611-3 is performing read DMA transfer, the data amount of the image data stored (stored) in the write buffer 2613W-2 is “full It is in the state of Therefore, the read / write switching control unit 2614 determines that the urgency of write DMA transfer by the bus master 2613-2 is high, and keeps the urgency signal UR at the “High” level indicating that the urgency is high.
  • the bus master 2613-1 ends the write DMA transfer at the timing t12. Then, in the example of the timing chart shown in FIG. 12, the read / write switching control unit 2614 keeps the read / write switching signal RW at the “Low” level notifying that priority is given to the write DMA transfer at timing t12. And the urgency signal UR remains at the “High” level, which indicates that the urgency is high.
  • the bus arbiter 231 accepts (permits an access request for write DMA transfer output from the bus master 2613-2. ), Maintain the current state of the DRAM 30.
  • the bus master 2613-2 can start the write DMA transfer immediately after timing t12.
  • the read / write switching control unit 2614 sets the urgency level signal UR to "Low” indicating that the urgency level is low. I'm on the level.
  • the bus master 2613-2 ends the write DMA transfer at timing t13.
  • the read / write switching control unit 2614 similarly notifies the read / write switching signal RW that priority is given to the write DMA transfer at the “Low” level, also after timing t13. I'm leaving. Therefore, in each of the bus masters 2613-1 and 2613-2, the data amount of the image data stored (stored) in the write buffer 2613 W becomes equal to or larger than the second write switching threshold, and then stored (stored). The write DMA transfer can be started immediately after the data amount of the image data becomes “full”.
  • the data amount of the image data stored (stored) in the write buffer 2613W-1 becomes equal to or greater than the second write switching threshold, and thereafter, at timing t15.
  • the data amount of stored image data is "full", it indicates the timing at which the bus master 2613-1 starts write DMA transfer.
  • the data amount of the image data stored (stored) in the write buffer 2613W-2 becomes equal to or greater than the second write switching threshold at timing t16.
  • the timing chart shows the timing at which the bus master 2613-2 starts the read DMA transfer immediately after the timing t17 when the 1 ends the write DMA transfer.
  • the read / write switching control unit 2614 observes the state of the read DMA transfer by the bus master 2611 and the state of the write DMA transfer by the bus master 2613. Also in the memory access device of the third embodiment, as in the memory access devices of the first and second embodiments, the read / write switching control unit 2614 notifies DMA transfer that it is desired to prioritize.
  • the read / write switching signal RW is output to the bus arbiter 231.
  • the read / write switching control unit 2614 stores the read buffer 2611R and the write buffer 2613W.
  • the read / write switching signal RW is changed in a state where the capacity has a certain margin.
  • the bus arbiter 231 requests an access request for read DMA transfer from the bus master 2611 or the bus master 2613. When accepting (permitting) an access request for write DMA transfer from the above, the access request for DMA transfer notified by the read / write switching signal RW is accepted (permission).
  • the read / write switching control unit 2614 monitors the parameters related to image processing performed by the image processing module 2602 and the observed bus master 2611. And, based on the status of each DMA transfer in the bus master 2613, the urgency level of each DMA transfer is determined, and the urgency level signal UR for notifying the urgency level is output to the bus arbiter 231. Also in the memory access device of the third embodiment, as in the memory access device of the second embodiment, the bus arbiter 231 responds to the urgency level signal UR when arbitrating the access request from each processing block. Then, the arbitration is performed by increasing the priority for accepting (permitting) the access request from the image processing unit 261.
  • the bus arbiter 231 Based on the read / write switching signal RW, an access request from the bus master 2611 or the bus master 2613 can be preferentially received (permitted).
  • the series of image processing by the image processing module 2602 and the DMA transfer with the DRAM 30 are facilitated. Can be done.
  • the imaging device 3 or the image processing device 22 equipped with the memory access device of the third embodiment, a system (the imaging device 2 or image processing) equipped with the memory access device according to the second embodiment Similar to the device 21), it is possible to suppress a reduction in the transfer efficiency of image data on the data bus 210, which may cause a failure of the system.
  • a system (the imaging device 2 or image processing device) equipped with the memory access device according to the second embodiment Similarly to 21), the image processing module 2602 that performs processing on image data transferred between the memory access device of the third embodiment and the DRAM 30 can smoothly perform a series of image processing.
  • the read / write switching signal RW is changed (switched) using either the first switching threshold or the second switching threshold, and the read DMA transfer performed by the bus master 2611 is performed.
  • the operation to switch between the write DMA transfer performed by the bus master 2613 has been described.
  • the operation of switching the DMA transfer in the image processing unit 262 is not limited to the operation using one of the first switching threshold and the second switching threshold, and the first switching threshold and the first switching threshold may be used.
  • the read DMA transfer performed by the bus master 2611 and the write DMA transfer performed by the bus master 2613 may be switched using both switching thresholds of 2 and the switching threshold.
  • the read / write switching control unit 2614 is provided with the read buffer 2611 R provided in the bus master 2611 and the write provided in the bus master 2613 in two steps using both the first switching threshold and the second switching threshold.
  • the amount of data stored (stored) in each of the buffers 2613 W may be determined, and the state of the read / write switching signal RW for notifying DMA transfer to be prioritized may be changed.
  • the operation of switching between the read DMA transfer performed by the bus master 2611 and the write DMA transfer performed by the bus master 2613 is the operation of switching the DMA transfer based on the first switching threshold shown in FIG. Since the operation can be easily understood from the operation of switching the DMA transfer based on the second switching threshold, the detailed description will be omitted.
  • the read / write switching control unit 2614 observes the state of DMA transfer in the bus master 2611 and the bus master 2613. Also in the memory access device according to the third embodiment, as in the memory access devices according to the first and second embodiments, the read / write switching control unit 2614 prioritizes the DMA transfer to be performed preferentially.
  • the read / write switching signal RW for notification is output to the bus arbiter 231 at an early timing.
  • the state of the DRAM 30 is appropriately switched, and the bus arbiter 231 receives the bus master 2611.
  • the bus arbiter 231 when receiving (permitting) an access request from the bus master 2613, it can receive (permit) an access request for DMA transfer of the one notified by the read / write switching signal RW.
  • the read / write switching control unit 2614 monitors the parameters related to image processing performed by the image processing module 2602 and the observed bus master 2611. And from the status of each DMA transfer in the bus master 2613, the urgency of each DMA transfer is determined. Then, in the memory access device of the third embodiment, as in the memory access device of the second embodiment, the urgency level signal UR for notifying the determined urgency of each DMA transfer is output to the bus arbiter 231. Do.
  • the bus arbiter 231 arbitrates the access request from each processing block provided in the image processing unit 261.
  • the access request from the image processing unit 261 can be accepted (permitted) with high priority and arbitration can be performed.
  • the bus arbiter 231 is On the basis of the read / write switching signal RW, an access request from the bus master 2611 or the bus master 2613 is preferentially received (permitted), and a series of image processing by the image processing module 2602 and DMA transfer with the DRAM 30 are It can be done smoothly.
  • the imaging device 3 or the image processing device 22 equipped with the memory access device of the third embodiment, a system (the imaging device 2 or image processing) equipped with the memory access device according to the second embodiment Similar to the device 21), it is possible to suppress a reduction in the transfer efficiency of image data on the data bus 210, which may cause a failure of the system.
  • a system (the imaging device 2 or image processing device) equipped with the memory access device according to the second embodiment Similarly to 21), the image processing module 2602 that performs processing on image data transferred between the memory access device of the third embodiment and the DRAM 30 can smoothly perform a series of image processing.
  • the read / write switching control unit constituting the memory access device of the present invention observes the state of DMA transfer by the bus master constituting the memory access device of the present invention. Do. More specifically, the read / write switching control unit requests each of the DMA transfer access request by the bus master and the data amount of the image data stored (stored) in each of the read buffer and the write buffer provided in the bus master. By observing the state of DMA transfer by the bus master. In each embodiment of the present invention, the read / write switching control unit constituting the memory access device of the present invention reads DMA based on the observed status of DMA transfer by the bus master constituting the memory access device of the present invention.
  • the switching threshold (first switching threshold) is used by the read / write switching control unit that constitutes the memory access device of the present invention to determine which DMA transfer is to be prioritized. Or generate a second switching threshold).
  • the read / write switching control unit constituting the memory access device of the present invention uses the generated switching threshold value to read buffer provided in the bus master constituting the memory access device of the present invention and The data amount of the image data stored (stored) in each of the light buffers is determined.
  • the read DMA transfer (read DMA transfer) and the write DMA transfer (write DMA transfer) based on the result determined by the read / write switching control unit configuring the memory access device of the present invention.
  • the read / write switching signal for notifying of the DMA transfer which is desired to be performed preferentially is output to the bus arbiter which configures the memory access apparatus of the present invention.
  • the memory access device of the present invention switches from reading data to reading data in the DRAM accessing state, and reading data from writing data to the writing state Switching can be done appropriately.
  • the bus arbiter that configures the memory access device of the present invention when the bus arbiter that configures the memory access device of the present invention receives (permits) an access request from the bus master that configures the memory access device of the present invention, the read / write switching signal is used. It accepts (permits) the notified DMA transfer access request to be made preferentially.
  • image processing by the image processing module that performs processing on image data that the memory access device of the present invention exchanges with the DRAM, and DMA transfer with the DRAM Can be done smoothly.
  • the read / write switching control unit constituting the memory access device of the present invention includes parameters related to image processing performed by the image processing module and a bus master constituting the observed memory access device of the present invention. From the status of DMA transfer, the urgency of each DMA transfer is determined. In each embodiment of the present invention, the read / write switching control unit constituting the memory access device of the present invention uses the urgency level signal for notifying the determined urgency of DMA transfer as the memory access device of the present invention. Output to the configuring bus arbiter.
  • the bus arbiter that configures the memory access device of the present invention arbitrates the access request from the bus master that configures the memory access device of the present invention, in response to the urgency level signal Arbitration is performed with a high priority for accepting (permitting) an access request from a bus master constituting the memory access device of the present invention.
  • the bus arbiter constituting the memory access device of the present invention is a read / write switching signal. It accepts (permits) an access request for DMA transfer to be given priority by being notified of.
  • image processing by the image processing module that performs processing on image data that the memory access device of the present invention exchanges with the DRAM, and DMA transfer with the DRAM Can be done smoothly.
  • the configuration in which one memory access device of the present invention is provided in the imaging device has been described.
  • the number of the memory access device of the present invention is not limited to one shown in each embodiment of the present invention, and a plurality of memory access devices of the present invention are provided. You may have.
  • the bus arbiter that constitutes the memory access device of the present invention may be configured to include only one common to a plurality of memory access devices of the present invention.
  • a plurality of sets of a bus master and a read / write switching control unit constituting the memory access device of the present invention are provided, and one bus arbiter constituting the memory access device of the present invention is output from each read / write switching control unit.
  • An access request from each bus master may be arbitrated based on the read / write switching signal or the urgency level signal.
  • each embodiment of the present invention the configuration in which the memory access apparatus of the present invention is included in the image processing apparatus mounted on the imaging apparatus has been described.
  • various systems other than the image processing apparatus and the imaging apparatus shown in each embodiment of the present invention can be considered as a system provided with a memory access apparatus for transferring data to and from the DRAM. Therefore, the processing apparatus and system to which the memory access apparatus based on the concept of the present invention can be applied are not limited at all. That is, the concept of the memory access device of the present invention can be similarly applied to any processing device or system as long as the processing device or system transfers data with the DRAM. And the same effect as the memory access device of the present invention can be obtained.
  • Imaging device 10 Image sensor (imaging device) 20, 21 and 22 image processing apparatus (imaging apparatus, image processing apparatus) 210 Data bus (imaging device, image processing device) 220 CPU (imaging device, image processing device) 230, 231 Bus Arbiter (Image Processing Device, Memory Access Device, Bus Arbiter) 240 DRAM Interface Unit (Image Processing Device, Memory Access Device, Bus Arbiter) 250 preprocessing unit (imaging device, image processing device) 260, 261, 262 Image processing unit (image processing apparatus, memory access apparatus, bus master, read / write switching control unit) 2601 Bus master (image processing device, memory access device, bus master) 2601R, 2611R, 2611R-1, 2611R-2, 2611R-3 Read buffer (image processing device, memory access device, bus master, read buffer) 2601 W, 2613 W, 2613 W-1, 2613 W-2 Write buffer (image processing device, memory access device, bus master, write buffer) 2602, 2602-1, 2602-2, 2602-3, 2602-4 Image processing

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Bus Control (AREA)

Abstract

データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、バスマスタがアクセスするメモリのデータに対する処理の停止を予測し、バスマスタにおけるアクセス要求の内、メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれのアクセス要求を優先するかを通知するリードライト切り替え制御部と、データバスに接続され、メモリへのアクセス要求を調停し、バスマスタから出力されたメモリへのアクセス要求を受け付ける際に、リードライト切り替え制御部によって通知された優先するアクセス要求を受け付け、受け付けたアクセス要求に応じてメモリへのアクセスを制御するバスアービタと、を備える。

Description

メモリアクセス装置、画像処理装置、および撮像装置
 本発明は、メモリアクセス装置、画像処理装置、および撮像装置に関する。
 静止画用カメラ、動画用カメラ、医療用内視鏡カメラ、または産業用内視鏡カメラなどの撮像装置では、搭載されたシステムLSIなどの画像処理装置によって、様々な画像処理が行われる。画像処理装置には、撮像装置における様々な画像処理を行うための複数の処理ブロックが内蔵されており、それぞれの処理ブロックは、画像処理装置の内部に設けられたデータバスに接続されている。また、画像処理装置では、データバスに接続されたそれぞれの処理ブロックが、バスマスタとして、画像処理装置の外部に接続された1つのDRAM(Dynamic Random Access Memory)を共有している。そして、画像処理装置では、それぞれの処理ブロック(バスマスタ)が、データバスを介したDMA(Direct Memory Access)転送によってDRAMにアクセスし、画像処理を行うための種々のデータの受け渡しを、DRAMを介して行っている。
 また、複数の処理ブロック(バスマスタ)で1つのDRAMを共有する構成の画像処理装置には、それぞれのバスマスタから出力されるDMA転送のアクセス要求を調停する調停回路(いわゆる、DMA調停回路)を備えている。調停回路は、それぞれのバスマスタから出力されるDRAMへのアクセス要求(いわゆる、DMA要求)を適切に調停しながら、DRAMに対する実際のアクセスを制御している。調停回路は、基本的に、それぞれのバスマスタの優先順位を表す優先度に基づいて、DRAMへのアクセス要求を受け付ける(許可する)バスマスタを決定する。これにより、画像処理装置では、それぞれのバスマスタがDRAMとの間でデータの受け渡しを行う際のデータバスにおけるデータの流れ、つまり、バス帯域を確保し、画像処理装置を搭載した撮像装置のシステム全体としての機能を実現する。
 また、近年では、撮像装置における高性能化が進んでいる。このため、撮像装置に搭載する画像処理装置においても、備える処理ブロック(バスマスタ)が増加し、それぞれの処理ブロックにおいて実行する処理も複雑化してきている。例えば、近年の画像処理装置では、撮影した画像を表示するための表示装置の高精細化に伴って、HDTV(High Definition TeleVision)に対応したフルHDサイズ(1920×1080)の解像度をもつ画像や、UHDTV(Ultra High Definition TeleVision)に対応した4Kサイズ(3840×2160)の解像度をもつ画像を表示させることができるようになっている。このため、画像処理装置では、データバスを介して受け渡しを行うデータ量も増加し、それぞれの処理ブロック(バスマスタ)がデータバスを介してDRAMにアクセスするために必要なバス帯域(単位時間あたりのデータアクセス量)が急増している。
 ところで、通常のDRAMには、データを読み出している状態からデータを書き込む状態への切り替えるとき、データを書き込んでいる状態からデータを読み出す状態への切り替えるとき、同じアドレスの記憶領域(バンク)に連続してアクセスするときなどにおいて、所定の時間(一定時間)の間、制御を受け付けることができないという制約がある。つまり、DRAMにアクセスする際に、アクセスが待たされる時間、いわゆる、ロス時間がある。このため、画像処理装置では、なるべくロス時間を減らして、DRAMに対するアクセスの効率化を図る必要がある。
 しかしながら、画像処理装置に備えた処理ブロック(バスマスタ)の中には、DRAMからデータを読み出して予め定めた処理を行った後、再びDRAMにデータを書き込む(書き戻す)というような動作を行う処理ブロック(バスマスタ)も存在する。このような処理ブロック(バスマスタ)では、データバスを介したDRAMからのデータの読み出しと、データバスを介したDRAMへのデータの書き込みとの切り替えが必要であるが、データバスを使用する際の優先度が低いと、DRAMを、データを読み出す状態からデータを書き込む状態に適切なタイミングで切り替えを行うことができず、目標とするバス帯域を確保することが困難になってしまう。これは、画像処理装置を搭載した撮像装置のシステムに破綻をきたす要因となる。
 そこで、例えば、特許文献1のようなDRAMに対するアクセスの効率化を図る技術が開示されている。特許文献1には、1つのメモリを複数のマスタが共有するシステムにおいて、要求転送速度と平均転送速度とに基づいて緊急度を判定し、緊急度の高いマスタからのメモリアクセス要求を優先して処理するバス調停を行う情報処理装置や情報処理方法が提案されている。これにより、特許文献1に開示された情報処理方法では、マスタのリアルタイム性を保証した上で、メモリバス転送効率を向上させることができる。
日本国特開2007-280253号公報
 しかしながら、上述したように、通常のDRAMでは、データを読み出している状態からデータを書き込む状態への切り替える際などにおいて、所定(一定)の時間のロス時間がある。そして、特許文献1に開示された技術では、メモリ(DRAM)におけるこのようなロス時間に関しての考慮がされていない。つまり、特許文献1に開示された技術には、優先度の高いマスタのアクセスがロス時間によって待たされた場合でも、リアルタイム性を保証しつつ、メモリバス転送効率を向上させる方法は開示されていない。このため、特許文献1に開示された技術では、それぞれのマスタごとに緊急度を判定してバス調停を行ったとしても、データを読み出している状態からデータを書き込む状態への切り替える際などにおけるロス時間によって、メモリバス転送効率が低下し、システムに破綻をきたしてしまうこともあり得る。
 本発明は、上記の課題認識に基づいてなされたものであり、複数の処理ブロックがDRAMを共有する場合に、DRAMからのデータの読み出しとDRAMへのデータの書き込みとの切り替えを適切に行って、システムに破綻をきたす要因を削減することができるメモリアクセス装置、画像処理装置、および撮像装置を提供することを目的としている。
 本発明の第1の態様によれば、メモリアクセス装置は、データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、を備える。
 本発明の第2の態様によれば、上記第1の態様のメモリアクセス装置において、前記リードライト切り替え制御部は、前記バスマスタから出力された前記リードアクセス要求の状態と、前記バスマスタから出力された前記ライトアクセス要求の状態と、前記バスマスタに備えた、前記メモリから読み出した予め定めたデータ量のデータを保存するリードバッファに保存されたデータのデータ量と、前記バスマスタに備えた、前記メモリに書き込む予め定めたデータ量のデータを保存するライトバッファに保存されたデータのデータ量と、を観測し、前記バスマスタにおける前記アクセス要求において、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するためのリードライト切り替え信号を出力し、前記バスアービタは、前記バスマスタから出力された前記アクセス要求を受け付ける際に、前記リードライト切り替え信号によって通知された優先する前記アクセス要求を受け付けてもよい。
 本発明の第3の態様によれば、上記第2の態様のメモリアクセス装置において、前記バスマスタは、少なくとも、前記リードバッファを備え、前記リードアクセス要求を出力するリードバスマスタと、前記ライトバッファを備え、前記ライトアクセス要求を出力するライトバスマスタと、によって構成されてもよい。
 本発明の第4の態様によれば、上記第2の態様または上記第3の態様のメモリアクセス装置において、前記リードライト切り替え制御部は、観測したそれぞれの状態に基づいて、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための切り替え閾値を生成し、前記リードバッファに保存されたデータのデータ量、および前記ライトバッファに保存されたデータのデータ量を、前記切り替え閾値を用いて判定し、前記リードバッファに保存されたデータのデータ量、または前記ライトバッファに保存されたデータのデータ量が、前記切り替え閾値に到達したと判定したときに、前記リードライト切り替え信号が表す優先する前記アクセス要求を切り換えてもよい。
 本発明の第5の態様によれば、上記第4の態様のメモリアクセス装置において、前記切り替え閾値は、前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記リードバッファに保存されたデータに対して処理を行う処理モジュールが、前記リードバッファに保存されたデータを読み出して処理を開始することができるデータ量と、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量とを加えたリード切り替え閾値と、前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに保存されたデータの前記メモリへの書き込みを開始することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いたライト切り替え閾値と、から構成されていてもよい。
 本発明の第6の態様によれば、上記第4の態様のメモリアクセス装置において、前記切り替え閾値は、前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記リードバッファに保存されたデータに対して処理を行う処理モジュールが、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量と、前記メモリから読み出したデータを前記リードバッファの全ての記憶容量に保存するまでの間に処理を行うことができるデータ量とを加えたリード切り替え閾値と、前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに前記処理モジュールが処理を行った後のデータを保存することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いたライト切り替え閾値と、から構成されていてもよい。
 本発明の第7の態様によれば、上記第2の態様または上記第3の態様のメモリアクセス装置において、前記リードライト切り替え制御部は、観測したそれぞれの状態に基づいて、前記リードバッファに保存されたデータを読み出して処理を行い、処理を行った後のデータを前記ライトバッファに保存する処理モジュールに、処理が待たされている状態が発生しているか否かと、前記データバスを介して受け渡しが行われているデータのデータ量が予め定めたデータ量よりも多いか否かとを判定し、前記処理モジュールに処理が待たされている状態が発生していない、または、前記処理モジュールに処理が待たされている状態が発生しているが、前記データバスを介して受け渡しが行われているデータのデータ量が前記予め定めたデータ量よりも多くないと判定した場合に、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための第1の切り替え閾値を生成し、前記処理モジュールに処理が待たされている状態が発生しており、前記データバスを介して受け渡しが行われているデータのデータ量が前記予め定めたデータ量よりも多いと判定した場合に、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための第2の切り替え閾値を生成し、前記リードバッファに保存されたデータのデータ量、および前記ライトバッファに保存されたデータのデータ量を、前記第1の切り替え閾値および前記第2の切り替え閾値のいずれか一方または両方を用いて判定し、前記リードバッファに保存されたデータのデータ量、または前記ライトバッファに保存されたデータのデータ量が、判定に用いた切り替え閾値に到達したと判定したときに、前記リードライト切り替え信号が表す優先する前記アクセス要求を切り換えてもよい。
 本発明の第8の態様によれば、上記第7の態様のメモリアクセス装置において、前記第1の切り替え閾値は、前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記処理モジュールが、前記リードバッファに保存されたデータを読み出して処理を開始することができるデータ量と、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量とを加えた第1のリード切り替え閾値と、前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに保存されたデータの前記メモリへの書き込みを開始することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いた第1のライト切り替え閾値と、から構成され、前記第2の切り替え閾値は、前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記処理モジュールが、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量と、前記メモリから読み出したデータを前記リードバッファの全ての記憶容量に保存するまでの間に処理を行うことができるデータ量とを加えた第2のリード切り替え閾値と、前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに前記処理モジュールが処理を行った後のデータを保存することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いた第2のライト切り替え閾値と、から構成されていてもよい。
 本発明の第9の態様によれば、上記第5の態様から上記第8の態様のいずれか一態様のメモリアクセス装置において、前記リードライト切り替え制御部は、予め設定された前記処理モジュールが行う処理に関する設定を用いて、前記バスマスタが出力した前記アクセス要求の緊急度を判定するための緊急度閾値を算出し、観測したそれぞれの状態に基づいて算出した、前記バスマスタが出力した前記アクセス要求が前記バスアービタに受け付けられていない前記アクセス要求の待ち時間が、前記緊急度閾値よりも長い場合に緊急度が高く、前記緊急度閾値よりも長くない場合に緊急度が低いことを通知するための緊急度信号を出力し、前記バスアービタは、前記メモリへのアクセス要求を調停する際に、前記緊急度信号によって緊急度が高いことが通知された前記バスマスタから出力された前記アクセス要求の優先度を高くして調停してもよい。
 本発明の第10の態様によれば、上記第9の態様のメモリアクセス装置において、前記緊急度閾値は、前記処理モジュールが行う処理が待たされる状態が発生しないように規定した、前記バスマスタによる前記メモリへのアクセスが終了するまでの限界の時間に、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記限界の時間に対する割合を乗算した時間の閾値であってもよい。
 本発明の第11の態様によれば、上記第9の態様のメモリアクセス装置において、前記緊急度閾値は、前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値であってもよい。
 本発明の第12の態様によれば、上記第9の態様のメモリアクセス装置において、前記緊急度閾値は、前記処理モジュールが処理を複数回に分けて行う場合において、前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける残りの処理の回数から求められる残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値であってもよい。
 本発明の第13の態様によれば、上記第9の態様のメモリアクセス装置において、前記緊急度閾値は、前記処理モジュールが処理を処理の量が異なる複数回に分けて行う場合において、前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける全体の処理の量と現在まで終了した処理の量から求められる残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値であってもよい。
 本発明の第14の態様によれば、画像処理装置は、データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、を具備したメモリアクセス装置、を備える。
 本発明の第15の態様によれば、撮像装置は、データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、を具備したメモリアクセス装置を備える画像処理装置、を備える。
 上記各態様によれば、複数の処理ブロックがDRAMを共有する場合に、DRAMからのデータの読み出しとDRAMへのデータの書き込みとの切り替えを適切に行って、システムに破綻をきたす要因を削減することができるメモリアクセス装置、画像処理装置、および撮像装置を提供することができるという効果が得られる。
本発明の第1の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。 本発明の第1の実施形態のメモリアクセス装置においてDMA転送の切り替えを判定する処理の処理手順を示したフローチャートである。 本発明の第1の実施形態のメモリアクセス装置におけるDMA転送の状態をまとめた表である。 本発明の第1の実施形態のメモリアクセス装置においてDMA転送を行うタイミングの一例を示したタイミングチャートである。 本発明の第1の実施形態のメモリアクセス装置においてDMA転送を行う別のタイミングの一例を示したタイミングチャートである。 本発明の第2の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。 本発明の第2の実施形態のメモリアクセス装置における通知の処理の処理手順を示したフローチャートである。 本発明の第2の実施形態のメモリアクセス装置においてDMA転送の緊急度を判定する処理の処理手順を示したフローチャートである。 本発明の第2の実施形態のメモリアクセス装置においてDMA転送の緊急度を判定するための緊急度閾値を算出する際のそれぞれの段階における時間の関係の一例を示した図である。 本発明の第3の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。 本発明の第3の実施形態のメモリアクセス装置においてDMA転送を行うタイミングの一例を示したタイミングチャートである。 本発明の第3の実施形態のメモリアクセス装置においてDMA転送を行う別のタイミングの一例を示したタイミングチャートである。
(第1の実施形態)
 以下、本発明の実施形態について、図面を参照して説明する。なお、以下の説明においては、本発明の第1の実施形態のメモリアクセス装置が、例えば、静止画用カメラや動画用カメラなどの撮像装置に搭載されている画像処理装置に備えられている場合について説明する。
 図1は、本発明の第1の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。図1に示した撮像装置1は、イメージセンサ10と、画像処理装置20と、DRAM(Dynamic Random Access Memory)30と、表示装置40と、を備えている。
 また、画像処理装置20は、CPU(Central Processing Unit)220と、バスアービタ230と、DRAMインターフェース部240と、前処理部250と、画像処理部260と、表示処理部270と、を備えている。また、画像処理部260は、バスマスタ2601と、画像処理モジュール2602と、リードライト切り替え制御部2603と、を備えている。また、バスマスタ2601は、リードバッファ2601Rと、ライトバッファ2601Wと、を備えている。画像処理装置20では、バスアービタ230と、前処理部250と、画像処理部260と、表示処理部270とのそれぞれが、共通のデータバス210に接続されている。
 なお、図1に示した撮像装置1では、画像処理装置20内の画像処理部260に備えたバスマスタ2601およびリードライト切り替え制御部2603と、バスアービタ230との構成が、第1の実施形態のメモリアクセス装置に相当する。
 撮像装置1は、イメージセンサ10によって被写体の静止画像または動画像を撮影する。そして、撮像装置1は、撮影した静止画像に応じた表示画像を表示装置40に表示させる。また、撮像装置1は、撮影した動画像に応じた表示画像を表示装置40に表示させる。なお、撮像装置1は、撮影した静止画像や動画像に応じた記録画像を、不図示の記録媒体に記録させることもできる。
 イメージセンサ10は、撮像装置1に備えた不図示のレンズによって結像された被写体の光学像を光電変換する固体撮像装置である。例えば、イメージセンサ10は、CCD(Charge Coupled Device:電荷結合素子)イメージセンサや、CMOS(Complementary Metal-Oxide Semiconductor:相補型金属酸化膜半導体)イメージセンサに代表される固体撮像装置である。イメージセンサ10は、撮像した被写体の光学像に応じた画素信号を、画像処理装置20に備えた前処理部250に出力する。
 DRAM30は、撮像装置1に備えた画像処理装置20において処理される様々なデータを記憶するメモリ(データ記憶部)である。DRAM30は、画像処理装置20に備えたDRAMインターフェース部240およびバスアービタ230を介してデータバス210に接続されている。DRAM30は、画像処理装置20におけるそれぞれの処理段階の画像のデータを記憶する。例えば、DRAM30は、イメージセンサ10から出力された画素信号に基づいて前処理部250が出力した画素のデータを記憶する。また、例えば、DRAM30は、画像処理装置20に備えた画像処理部260が生成した画像(静止画像、動画像、表示画像、記録画像など)のデータを記憶する。
 表示装置40は、画像処理装置20に備えた表示処理部270から出力された表示画像を表示する表示装置である。表示装置40には、表示する表示画像の大きさ、つまり、画素数が異なる様々な表示装置がある。例えば、表示装置40には、VGA(640×480)サイズの画像を表示するTFT(薄膜トランジスター:Thin Film Transistor)液晶ディスプレイ(LCD:Liquid Crystal Display)や、EVF(Electronic View Finder:電子ビューファインダ)など、撮像装置1に搭載され、撮影する被写体を確認するためのビューファインダとして動作する小型の表示装置がある。また、例えば、表示装置40には、フルHD(1920×1080)サイズの画像を表示するHDTV(High Definition TeleVision)や、4K2K(3840×2160)サイズの画像を表示するUHDTV(Ultra High Definition TeleVision)など、撮像装置1に着脱できる構成であり、静止画像や動画像に応じた表示画像を表示して確認するための大型の表示装置もある。
 画像処理装置20は、イメージセンサ10から出力された画素信号に対して予め定めた画像処理を行って、静止画像や動画像を生成する。また、画像処理装置20は、生成した静止画像や動画像に応じた表示画像を生成する。そして、画像処理装置20は、生成した表示画像を表示装置40に表示させる。また、画像処理装置20は、生成した静止画像や動画像に応じた記録画像を生成し、生成した記録画像を不図示の記録媒体に記録させることもできる。
 画像処理装置20では、前処理部250と、画像処理部260と、表示処理部270とのそれぞれが、画像処理装置20において実行する画像処理の処理機能を実現する処理ブロックである。画像処理装置20では、前処理部250、画像処理部260、および表示処理部270のそれぞれが、データバス210を介したDMA(Direct Memory Access)転送によってDRAM30にアクセスする。
 CPU220は、画像処理装置20に備えたそれぞれの構成要素を制御することによって、画像処理装置20の全体を制御する制御部である。CPU220は、それぞれの構成要素を制御するためのプログラムやデータに応じて、画像処理装置20の全体を制御する。なお、CPU220は、撮像装置1に備えた構成要素を制御してもよい。CPU220が画像処理装置20に備えたそれぞれの構成要素を制御するためのプログラムやデータは、DRAMインターフェース部240およびバスアービタ230を介してデータバス210に接続されたDRAM30に記憶されているものであってもよい。この場合、CPU220は、DRAM30に記憶されているプログラムやデータを、バスアービタ230およびDRAMインターフェース部240を介して読み出して実行することによって、画像処理装置20の全体を制御する。
 バスアービタ230は、データバス210に接続されている画像処理装置20内のそれぞれの処理ブロックからのDMA転送によるDRAM30へのアクセス要求(DMA要求)を調停し、いずれかの処理ブロックからのDRAM30へのアクセス要求を受け付ける調停回路(いわゆる、DMA調停回路)である。バスアービタ230は、画像処理装置20に備えたそれぞれの処理ブロックの優先度に基づいて、アクセス要求信号(DMA要求信号)を出力してきたそれぞれの処理ブロックの中から、DRAM30へのアクセス要求を受け付ける(許可する)処理ブロックを決定する。
 このとき、バスアービタ230は、画像処理部260を、DRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定する場合には、画像処理部260から出力されたリードライト切り替え信号RWに基づいて、受け付ける(許可する)DRAM30へのアクセス方向(書き込みまたは読み出し)を決定する。つまり、バスアービタ230は、画像処理部260によるDRAM30からのデータの読み出しのアクセス(リードアクセス)を受け付ける(許可する)のか、画像処理部260によるDRAM30へのデータの書き込み(ライトアクセス)を受け付ける(許可する)のかを、画像処理部260から出力されたリードライト切り替え信号RWに基づいて切り替える。
 そして、バスアービタ230は、それぞれの処理ブロックからのDRAM30へのアクセス要求を調停した結果、アクセス要求を受け付ける(許可する)と決定した処理ブロックに、アクセス要求を受け付けたことを通知するためのアクセス受け付け信号(いわゆる、DMA許可信号)を出力する。
 その後、バスアービタ230は、アクセス要求を受け付けた処理ブロックとの間でデータバス210を介したデータの受け渡しを行う。このとき、バスアービタ230は、アクセス要求を受け付けた処理ブロックからアクセス要求信号と共に出力されてきたアドレス(バンクを含む)やアクセス方向(書き込みまたは読み出し)など、DRAM30へのアクセスに関する情報(アクセス情報)をDRAMインターフェース部240に出力(転送)する。なお、バスアービタ230は、DRAM30にデータを書き込むライトアクセスを行う場合には、アクセス要求を受け付けた処理ブロックからデータバス210を介して出力されたデータもDRAMインターフェース部240に出力(転送)する。一方、バスアービタ230は、DRAM30からデータを読み出すリードアクセスを行う場合には、出力したDRAM30へのアクセス情報に応じてDRAMインターフェース部240から出力されたデータを、データバス210を介してアクセス要求を受け付けた処理ブロックに出力(転送)する。
 DRAMインターフェース部240は、バスアービタ230から出力されたアクセス情報に基づいて、DRAM30との間で実際にデータの受け渡しを行う、つまり、実際にデータの転送(DMA転送)を行うDRAMコントローラーである。DRAMインターフェース部240は、バスアービタ230がアクセス要求を受け付けた処理ブロックから出力され、バスアービタ230から出力(転送)されてきたDRAM30へのアクセス情報に基づいて、DRAM30を制御する。このとき、DRAMインターフェース部240は、DRAM30に対してライトアクセスを行う場合には、バスアービタ230から出力(転送)されてきた、バスアービタ230がアクセス要求を受け付けた処理ブロックがデータバス210に出力したデータを、アクセス情報によって指定されたDRAM30のアドレスの記憶領域に記憶させる(書き込む)。一方、DRAMインターフェース部240は、DRAM30に対してリードアクセスを行う場合には、アクセス情報によって指定されたDRAM30のアドレスの記憶領域に記憶されているデータを読み出し、読み出したデータをバスアービタ230に出力する。
 前処理部250は、イメージセンサ10から出力された画素信号のデータに対して予め定めた種々の画像処理を施す処理ブロックである。前処理部250がイメージセンサ10から出力された画素信号のデータに対して施す画像処理は、例えば、キズ補正やシェーディング補正などの、いわゆる、前処理である。なお、本発明においては、前処理部250がイメージセンサ10から出力された画素信号のデータに対して施す画像処理(前処理)に関しては、特に制限はしない。前処理部250は、前処理を施した後の画素信号のデータ(以下、「前処理画像データ」という)を、DMA転送によってDRAM30に記憶させる(書き込む)。
 前処理部250は、前処理画像データをDRAM30に記憶させる(書き込む)際に、DRAM30へのライトアクセスを要求するためのアクセス要求信号(DMA要求信号)と、前処理画像データを記憶させるDRAM30の記憶領域(バンクを含む)を指定するアドレス(DMAアドレス)と、DRAM30に対する書き込みのアクセス方向であることを表すアクセス方向信号(DMAライト信号)とを、バスアービタ230に出力する。そして、前処理部250は、出力したアクセス要求信号がバスアービタ230に受け付けられた後に、つまり、バスアービタ230からアクセス受け付け信号(DMA許可信号)が入力された後に、前処理画像データをバスアービタ230に出力する。これにより、前処理部250が出力した前処理画像データが、バスアービタ230およびDRAMインターフェース部240を介してDRAM30に出力され、アクセス要求信号と共に出力したアドレス(DMAアドレス)の記憶領域に記憶される(書き込まれる)。
 なお、前処理部250は、イメージセンサ10から出力された画素信号のデータを一時的に保存してから前処理を施す構成であってもよい。また、前処理部250は、前処理を施した前処理画像データを一時的に保存した後に、DMA転送においてバスアービタ230に出力する構成であってもよい。
 画像処理部260は、DRAM30に記憶された前処理画像データに対して予め定めた画像処理を施す処理ブロックである。画像処理部260では、画像処理を施す対象の前処理画像データを取得する(読み出す)ためのDMA転送と、画像処理を施して生成した画像データをDRAM30に記憶する(書き込む)ためのDMA転送とを行う。より具体的には、画像処理部260は、画像処理を施す対象の前処理画像データを、DMA転送によってDRAM30から取得する(読み出す)。そして、画像処理部260は、取得した前処理画像データに対して予め定めた画像処理を施す。その後、画像処理部260は、画像処理を施した後の画像データを、DMA転送によってDRAM30に記憶させる(書き込む)。上述したように、画像処理部260は、バスマスタ2601と、画像処理モジュール2602と、リードライト切り替え制御部2603と、を備えている。
 画像処理モジュール2602は、画像処理部260において前処理画像データに対して行う予め定めた画像処理を実行する処理モジュールである。画像処理モジュール2602が、前処理画像データに対して行う画像処理としては、例えば、ノイズ除去処理、YC(輝度色差)変換処理、歪補正処理、リサイズ処理、JPEG圧縮処理などの静止画像圧縮処理、MPEG圧縮処理やH.264圧縮処理などの動画像圧縮処理など、各種の表示用の画像処理や記録用の画像処理がある。画像処理モジュール2602は、取得した前処理画像データに対して上述したような予め定めた画像処理を施して、静止画像の画像データ(以下、「静止画像データ」という)や、動画像の画像データ(以下、「動画像データ」という)を生成する。なお、本発明においては、画像処理モジュール2602が前処理画像データに対して施す画像処理に関しては、特に制限はしない。なお、画像処理モジュール2602は、不図示の記録媒体に記録された記録画像のデータに対して、例えば、JPEG伸張処理などの静止画像伸張処理、MPEG伸張処理やH.264伸張処理などの動画像伸張処理などの画像処理を行う構成であってもよい。なお、以下の説明においては、画像処理モジュール2602が生成した静止画像データと動画像データとを区別せずに表すときには、「画像処理画像データ」という。
 バスマスタ2601は、DRAM30と画像処理モジュール2602との間でDMA転送を行うDMA転送部である。バスマスタ2601は、画像処理モジュール2602が画像処理を行う対象の前処理画像データをDRAM30から取得する(読み出す)DMA転送と、画像処理モジュール2602が画像処理を行った後の画像処理画像データ(静止画像データや動画像データ)をDRAM30に記憶させる(書き込む)DMA転送とを行う。つまり、バスマスタ2601は、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う。上述したように、バスマスタ2601は、リードバッファ2601Rと、ライトバッファ2601Wと、を備えている。
 リードバッファ2601Rとライトバッファ2601Wとのそれぞれは、予め定めたデータ量(例えば、画素数)の画像データ(前処理画像データ、静止画像データや動画像データ)を一時的に記憶(保存)するデータ記憶部である。リードバッファ2601Rとライトバッファ2601Wとのそれぞれは、例えば、SRAM(Static Random Access Memory)などのメモリで構成される。
 バスマスタ2601は、DMA転送によってDRAM30から取得した(読み出した)前処理画像データを、リードバッファ2601Rに一時的に記憶(保存)し、予め定めたデータ量の前処理画像データを記憶(保存)した後に、画像処理モジュール2602からの要求に応じて、記憶(保存)している前処理画像データを画像処理モジュール2602に出力する。つまり、バスマスタ2601は、DMA転送によってDRAM30から取得した(読み出した)前処理画像データを、画像処理モジュール2602が画像処理を行うタイミングに合わせて、画像処理モジュール2602に出力する。また、バスマスタ2601は、画像処理モジュール2602が画像処理を行って生成した画像処理画像データ(静止画像データや動画像データ)を、ライトバッファ2601Wに一時的に記憶(保存)し、予め定めたデータ量の画像処理画像データを記憶(保存)した後に、DMA転送のタイミングに合わせて、記憶(保存)している画像処理画像データをバスアービタ230に出力して、DRAM30に記憶させる(書き込む)。
 リードライト切り替え制御部2603は、バスマスタ2601が行うDMA転送の状態を観測して、バスアービタ230によってアクセス要求の受け付け(許可)をされたい、画像処理部260におけるDRAM30へのアクセス方向(書き込みまたは読み出し)を通知する。
 より具体的には、リードライト切り替え制御部2603は、バスマスタ2601が前処理画像データをDRAM30から取得する(読み出す)リードアクセスの要求と、リードアクセスの要求の受け付け(許可)と、リードバッファ2601Rに記憶(保存)されている前処理画像データのデータ量とのそれぞれを観測することによって、バスマスタ2601によるリードアクセスのDMA転送の状態を観測する。図1に示した画像処理部260では、リードアクセス観測信号RAによってバスマスタ2601によるリードアクセスの要求および受け付け(許可)を観測し、リードバッファ観測信号RBによってリードバッファ2601Rに記憶されている前処理画像データのデータ量を観測している。なお、リードアクセス観測信号RAは、例えば、バスマスタ2601がリードアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ230がリードアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、リードバッファ観測信号RBは、リードバッファ2601Rの全ての記憶容量に前処理画像データが記憶(保存)されているか否かを表す信号や、リードバッファ2601Rにおける予め定めた割合よりも多くの記憶容量に前処理画像データが記憶(保存)されているか否かを表す信号である。
 また、リードライト切り替え制御部2603は、バスマスタ2601が画像処理画像データ(静止画像データや動画像データ)をDRAM30に記憶させる(書き込む)ライトアクセスの要求と、ライトアクセスの要求の受け付け(許可)と、ライトバッファ2601Wに記憶(保存)されている画像処理画像データのデータ量とのそれぞれを観測することによって、バスマスタ2601によるライトアクセスのDMA転送の状態を観測する。図1に示した画像処理部260では、ライトアクセス観測信号WAによってバスマスタ2601によるライトアクセスの要求および受け付け(許可)を観測し、ライトバッファ観測信号WBによってライトバッファ2601Wに記憶されている画像処理画像データのデータ量を観測している。なお、ライトアクセス観測信号WAは、例えば、バスマスタ2601がライトアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ230がライトアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、ライトバッファ観測信号WBは、ライトバッファ2601Wの全ての記憶容量に画像処理画像データが記憶(保存)されているか否かを表す信号や、ライトバッファ2601Wにおける予め定めた割合よりも多くの記憶容量に画像処理画像データが記憶(保存)されているか否かを表す信号である。
 リードライト切り替え制御部2603は、観測したそれぞれのDMA転送の状態に基づいて、バスマスタ2601によるリードアクセスのDMA転送(以下、「リードDMA転送」という)と、ライトアクセスのDMA転送(以下、「ライトDMA転送」という)とのいずれのDMA転送を優先して行うかを判定する。そして、リードライト切り替え制御部2603は、判定した結果に基づいて、優先して行いたいDMA転送、つまり、バスアービタ230によってアクセス要求の受け付け(許可)をされたいDMA転送を通知するためのリードライト切り替え信号RWを生成する。
 なお、リードライト切り替え制御部2603が優先するDMA転送を判定するために用いるパラメータは、CPU220によって、リードライト切り替え制御部2603のレジスタに設定される。
 リードライト切り替え制御部2603は、生成したリードライト切り替え信号RWをバスアービタ230に出力することによって、優先して行いたいDMA転送(リードDMA転送またはライトDMA転送)を通知する。これにより、バスアービタ230は、画像処理部260(より具体的には、バスマスタ2601)からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWに基づいて、DRAM30から前処理画像データを取得する(読み出す)リードDMA転送、またはDRAM30に画像処理画像データを記憶させる(書き込む)ライトDMA転送のいずれか一方のDMA転送のアクセス要求を受け付ける(許可する)。
 表示処理部270は、DRAM30に記憶された画像処理画像データ(静止画像データや動画像データ)を取得し(読み出し)、取得した画像処理画像データに応じた表示画像を表示装置40に表示させる処理ブロックである。表示処理部270は、表示装置40に表示させるための画像処理画像データを、DMA転送によってDRAM30から取得する(読み出す)。
 表示処理部270は、画像処理画像データをDRAM30から取得する(読み出す)際に、DRAM30へのリードアクセスを要求するためのアクセス要求信号(DMA要求信号)と、画像処理画像データを取得するDRAM30の記憶領域(バンクを含む)を指定するアドレス(DMAアドレス)と、DRAM30に対する読み出しのアクセス方向であることを表すアクセス方向信号(DMAリード信号)とを、バスアービタ230に出力する。そして、表示処理部270は、出力したアクセス要求信号がバスアービタ230に受け付けられた後に、つまり、バスアービタ230からアクセス受け付け信号(DMA許可信号)が入力された後に、DRAMインターフェース部240がDRAM30から読み出してバスアービタ230を介して出力された画像処理画像データを取得する。そして、表示処理部270は、取得した画像処理画像データに応じた表示画像を表示装置40に出力して表示させる。
 なお、表示処理部270は、DRAM30から読み出した(取得した)画像処理画像データに対して予め定めた表示処理を施して生成した表示画像を表示装置40に出力して表示させる構成であってもよい。なお、表示処理部270が画像処理画像データに対して施す表示処理としては、例えば、表示装置40が表示する画像のサイズに表示画像のサイズを変換する処理や、例えば、撮影日時などの静止画像や動画像に関する様々な情報を表示させるためのオンスクリーンディスプレイ(On Screen Display:OSD)画像を重畳する処理などがある。しかし、本発明においては、表示処理部270が画像処理画像データに対して施す表示処理に関しては、特に制限はしない。また、表示処理部270は、DRAM30から読み出した(取得した)画像処理画像データを一時的に保存してから表示処理を施す構成であってもよい。また、表示処理部270は、表示処理を施した表示画像のデータを一時的に保存した後に、保存した表示画像のデータを表示装置40に出力して表示させる構成であってもよい。
 このような構成によって、撮像装置1は、イメージセンサ10によって被写体の静止画像や動画像を撮影し、撮影した静止画像や動画像に応じた表示画像を表示装置40に表示させる。また、撮像装置1は、イメージセンサ10によって撮影した静止画像や動画像に応じた記録画像を、不図示の記録媒体に記録させることもできる。
 また、撮像装置1では、画像処理装置20内の画像処理部260に備えたバスマスタ2601およびリードライト切り替え制御部2603と、バスアービタ230とで、第1の実施形態のメモリアクセス装置を構成する。言い換えれば、画像処理装置20において、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う処理ブロックである画像処理部260に、第1の実施形態のメモリアクセス装置が構成される。
 そして、第1の実施形態のメモリアクセス装置では、バスマスタ2601がDRAM30との間で画像データの受け渡しを行う際に、リードライト切り替え制御部2603が、バスマスタ2601によるDMA転送の状態を観測する。そして、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が、観測したバスマスタ2601によるDMA転送の状態に基づいて、読み出しのDMA転送(リードDMA転送)と書き込みのDMA転送(ライトDMA転送)との内、優先して行いたい方のDMA転送を通知するためのリードライト切り替え信号RWを、バスアービタ230に出力する。これにより、第1の実施形態のメモリアクセス装置では、バスアービタ230が、バスマスタ2601からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)。これにより、第1の実施形態のメモリアクセス装置では、バスマスタ2601によるDRAM30からの画像データ(前処理画像データ)の読み出しと画像データ(画像処理画像データ)の書き込みとの切り替えを適切に行うことができる。このことにより、第1の実施形態のメモリアクセス装置を搭載したシステム(撮像装置1や画像処理装置20)では、DRAM30の状態を、データを読み出している状態からデータを書き込む状態への切り替えるときや、データを書き込んでいる状態からデータを読み出す状態への切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。つまり、第1の実施形態のメモリアクセス装置を搭載したシステムに破綻をきたす要因となり得る、データバス210における画像データの転送効率の低下を少なくする(抑える)ことができる。そして、第1の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602は、画像データに対する一連の画像処理を、円滑に行うことができる。
 ここで、画像処理部260の動作について説明する。まず、画像処理部260が画像データをDMA転送する際の基本的な動作について説明する。
 画像処理部260が画像処理を行う場合、まず、バスマスタ2601が、画像処理を施す対象の前処理画像データを、DMA転送によってDRAM30から取得する(読み出す)。バスマスタ2601は、DRAM30から前処理画像データを取得する(読み出す)際に、DRAM30へのリードアクセスを要求するためのアクセス要求信号(DMA要求信号)と、前処理画像データを取得するDRAM30の記憶領域(バンクを含む)を指定するアドレス(DMAアドレス)と、DRAM30に対する読み出しのアクセス方向であることを表すアクセス方向信号(DMAリード信号)とを、バスアービタ230に出力する。そして、バスマスタ2601は、出力したアクセス要求信号がバスアービタ230に受け付けられた後に、つまり、バスアービタ230からアクセス受け付け信号(DMA許可信号)が入力された後に、DRAMインターフェース部240がDRAM30から読み出してバスアービタ230を介して出力された前処理画像データを、リードバッファ2601Rに一時的に保存する。その後、バスマスタ2601は、予め定めたデータ量の前処理画像データをリードバッファ2601Rに記憶(保存)した後、画像処理モジュール2602から要求に応じて、リードバッファ2601Rに保存した前処理画像データを読み出して、画像処理モジュール2602に出力する。これにより、画像処理モジュール2602は、バスマスタ2601(より具体的には、リードバッファ2601R)から出力された前処理画像データに対して予め定めた画像処理を施して、画像処理画像データ(静止画像データや動画像データ)を生成し、生成した画像処理画像データを、バスマスタ2601に出力する。
 バスマスタ2601は、画像処理モジュール2602から出力された画像処理画像データを、ライトバッファ2601Wに一時的に保存する。その後、バスマスタ2601は、予め定めたデータ量の画像処理画像データをライトバッファ2601Wに記憶(保存)した後、ライトバッファ2601Wに記憶(保存)した画像処理画像データを、DMA転送によってDRAM30に記憶させる(書き込む)。バスマスタ2601は、画像処理画像データをDRAM30に記憶させる(書き込む)際に、DRAM30へのライトアクセスを要求するためのアクセス要求信号(DMA要求信号)と、画像処理画像データを記憶させるDRAM30の記憶領域(バンクを含む)を指定するアドレス(DMAアドレス)と、DRAM30に対する書き込みのアクセス方向であることを表すアクセス方向信号(DMAライト信号)とを、バスアービタ230に出力する。そして、バスマスタ2601は、出力したアクセス要求信号がバスアービタ230に受け付けられた後に、つまり、バスアービタ230からアクセス受け付け信号(DMA許可信号)が入力された後に、ライトバッファ2601Wに保存した画像処理画像データを読み出してバスアービタ230に出力する。これにより、バスマスタ2601が出力した画像処理画像データ(静止画像データや動画像データ)が、バスアービタ230およびDRAMインターフェース部240を介してDRAM30に出力され、アクセス要求信号と共に出力したアドレス(DMAアドレス)の記憶領域に記憶される(書き込まれる)。
 このように、画像処理部260では、DRAM30から画像処理を行う対象の前処理画像データを取得する(読み出す)際、および画像処理を行った後の画像処理画像データ(静止画像データや動画像データ)をDRAM30に記憶させる(書き込む)際に、バスマスタ2601に備えたリードバッファ2601Rとライトバッファ2601Wとを介して、DRAM30との間でそれぞれの画像データの受け渡しを行う。これにより、画像処理部260では、画像処理モジュール2602が、DRAM30との間で行うDMA転送のタイミングに影響されることなく、予め定めた画像処理を行うことができる。
 ところで、画像処理モジュール2602が前処理画像データに対して行う画像処理は、1つのフレームの全体の領域に対して同時期に処理を行うことができる画像処理のみであるとは限らない。例えば、歪補正処理やJPEG圧縮処理では、1つのフレームの領域を複数の矩形のブロックに分割し、分割したそれぞれのブロックごとに処理を順次行って、全てのブロックに対する処理が完了したときに、全体の領域に対する処理が完了する。また、バスマスタ2601に備えたリードバッファ2601Rとライトバッファ2601Wとそれぞれは、1フレーム分の全ての前処理画像データまたは画像処理画像データを記憶することができる記憶容量を備えると、回路規模やコストが増加する。このため、リードバッファ2601Rやライトバッファ2601Wの記憶容量は、1フレーム分の画像データを記憶(保存)することができるデータ量よりも少ないことが一般的である。このように、バスマスタ2601では、1フレーム分の前処理画像データを複数回に分けてDRAM30から取得し(読み出し)、1フレーム分の画像データを複数回に分けてDRAM30に記憶させる(書き込む)動作を行う必要がある状況になることがある。つまり、画像処理部260において1フレームの前処理画像データに基づいた1フレームの画像処理画像データ(静止画像データや動画像データ)を生成する際に、バスマスタ2601が、リードアクセスのDMA転送(リードDMA転送)とライトアクセスのDMA転送(ライトDMA転送)との切り替えを複数回行うことが必要となることがある。言い換えれば、DRAM30において、画像データ(前処理画像データ)を読み出している状態から画像データ(画像処理画像データ)を書き込む状態への切り替えや、画像データ(画像処理画像データ)を書き込んでいる状態から画像データ(前処理画像データ)を読み出す状態への切り替えが複数回行われるということである。
 DRAM30においては、上述したように、画像データを読み出している状態から画像データを書き込む状態、またはその逆の状態に切り替える際に、所定の時間(一定時間)を必要とする。この所定の時間(一定時間)は、DRAM30における画像データの転送のロス時間であり、画像処理部260とDRAM30との間のデータバス210を介した画像データの転送効率が低下する要因となる。このため、画像処理部260では、所定の時間(一定時間)を要するDRAM30の状態の切り替えをなるべく行わない方が、システムに破綻をきたす要因となるロス時間を削減することができる。しかしながら、上述したように、画像処理モジュール2602が行う画像処理の種類や、リードバッファ2601Rとライトバッファ2601Wとそれぞれの記憶容量によっては、ロス時間が発生することを容認した上で、DRAM30の状態の切り替えを行わなければならない場合もある。ただし、この場合でも、DRAM30の状態の切り替えは少ない方がよい。
 そこで、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が、バスマスタ2601が行うDMA転送の状態を観測して、バスマスタ2601においてリードDMA転送とライトDMA転送とが適切に切り替わるように制御する。このとき、リードライト切り替え制御部2603は、観測したDMA転送の状態に基づいて、リードDMA転送とライトDMA転送とのいずれのDMA転送を優先して行うかを判定する。この判定は、バスマスタ2601が行うリードDMA転送とライトDMA転送とにおける余裕度や、データバス210の混雑度を判定することによって行う。つまり、リードライト切り替え制御部2603は、バスマスタ2601が、画像処理モジュール2602が画像処理を行う対象の前処理画像データを出力するためのリードDMA転送が滞りなく行われているか、画像処理モジュール2602が画像処理を行って生成した画像処理画像データをDRAM30に記憶させる(書き込む)ためのライトDMA転送が滞りなく行われているかを、観測したDMA転送の状態によって判定する。言い換えれば、リードライト切り替え制御部2603は、画像処理モジュール2602が実行する画像処理が待たされている状態が発生しているか否か、つまり、画像処理が停止していないかを、観測したDMA転送の状態によって判定する。また、リードライト切り替え制御部2603は、データバス210を介して受け渡しが行われているデータ(他の処理ブロックが生成した画像データを含む)のデータ量が予め定めたデータ量よりも多いか否か、つまり、現在どれくらいのデータの受け渡しがデータバス210を介して行われているのかを、観測したDMA転送の状態によって判定する。
 次に、第1の実施形態のメモリアクセス装置において、リードライト切り替え制御部2603が、リードDMA転送とライトDMA転送とのいずれのDMA転送を優先して行うかを判定する方法について説明する。図2は、本発明の第1の実施形態のメモリアクセス装置においてDMA転送の切り替えを判定する処理の処理手順を示したフローチャートである。
 上述したように、リードライト切り替え制御部2603は、リードDMA転送におけるリードアクセスの要求およびリードバッファ2601Rに記憶(保存)されている前処理画像データのデータ量と、ライトDMA転送におけるライトアクセスの要求およびライトバッファ2601Wに記憶(保存)されている画像処理画像データのデータ量とのそれぞれを、バスマスタ2601が行うDMA転送の状態として観測する。そして、リードライト切り替え制御部2603は、まず、観測したDMA転送の状態に基づいて、画像処理モジュール2602が実行する画像処理が待たされている状態が発生しているか否かを判定する(ステップS110)。
 ステップS110において、画像処理モジュール2602が行う画像処理に待ちの状態が発生していないと判定した場合(ステップS110の“NO”)、リードライト切り替え制御部2603は、ステップS130に進む。
 一方、ステップS110において、画像処理モジュール2602が行う画像処理に待ちの状態が発生していると判定した場合(ステップS110の“YES”)、リードライト切り替え制御部2603は、データバス210の混雑度が、予め定めた混雑度よりも大きいか否かを判定する(ステップS120)。
 ステップS120において、データバス210の混雑度が予め定めた混雑度よりも大きくない、つまり、データバス210を介して受け渡しが行われているデータのデータ量が、混雑度が表す予め定めたデータ量以下であると判定した場合(ステップS120の“NO”)、リードライト切り替え制御部2603は、ステップS130に進む。
 一方、ステップS120において、データバス210の混雑度が予め定めた混雑度よりも大きい、つまり、データバス210を介して受け渡しが行われているデータのデータ量が、混雑度が表す予め定めたデータ量よりも多いと判定した場合(ステップS120の“YES”)、リードライト切り替え制御部2603は、ステップS140に進む。
 リードライト切り替え制御部2603は、ステップS110において画像処理モジュール2602が行う画像処理に待ちの状態が発生していないと判定した場合(ステップS110の“NO”)、またはステップS120においてデータバス210の混雑度が予め定めた混雑度よりも大きくないと判定した場合(ステップS120の“NO”)に、第1の切り替え閾値を生成する(ステップS130)。
 また、リードライト切り替え制御部2603は、ステップS120においてデータバス210の混雑度が予め定めた混雑度よりも大きいと判定した場合(ステップS120の“YES”)に、第2の切り替え閾値を生成する(ステップS140)。
 このような処理によって、リードライト切り替え制御部2603は、第1の切り替え閾値または第2の切り替え閾値を生成する。そして、リードライト切り替え制御部2603は、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量と、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量とを、生成した第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いて判定する。リードライト切り替え制御部2603は、判定した結果に基づいて、優先して行いたいDMA転送を決定する。つまり、リードライト切り替え制御部2603は、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いて、リードDMA転送を優先して行うか、ライトDMA転送を優先して行うかを決定する。そして、リードライト切り替え制御部2603は、決定したDMA転送に切り替えることを通知するためのリードライト切り替え信号RWを生成して、バスアービタ230に出力する。これにより、バスアービタ230は、画像処理部260を、DRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、画像処理部260(より具体的には、リードライト切り替え制御部2603)から出力されたリードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)。
 なお、リードライト切り替え制御部2603は、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値のみを生成し、生成した切り替え閾値のみを用いて、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量と、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量とを判定する構成であってもよい。つまり、リードライト切り替え制御部2603は、常に、生成した第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値のみを用いて、リードDMA転送を優先して行うか、ライトDMA転送を優先して行うかを決定する構成であってもよい。
 ここで、ステップS110における画像処理モジュール2602が実行する画像処理が待たされている状態か否かの判定方法について説明する。図3は、本発明の第1の実施形態のメモリアクセス装置におけるDMA転送の状態をまとめた表である。図3には、リードライト切り替え制御部2603が観測した、バスマスタ2601におけるDMA転送の状態の一例を示している。
 図3に示したDMA転送の状態をまとめた表の「リードバッファ」の項目において、「エンプティ」は、リードバッファ2601Rに前処理画像データを記憶(保存)するための記憶容量に空きがあることを示し、「フル」は、リードバッファ2601Rに前処理画像データを記憶(保存)するための記憶容量に空きがないことを示している。例えば、リードライト切り替え制御部2603が、画像処理モジュール2602が画像処理を行うのに十分なデータ量の前処理画像データがリードバッファ2601Rに記憶(保存)されていることを観測した場合には、「リードバッファ」の項目は「フル」となる。一方、リードライト切り替え制御部2603が、画像処理モジュール2602が画像処理を行うのに十分なデータ量の前処理画像データがリードバッファ2601Rに記憶(保存)されていることを観測できない場合には、「リードバッファ」の項目は「エンプティ」となる。
 また、図3に示したDMA転送の状態をまとめた表の「ライトバッファ」の項目において、「エンプティ」は、ライトバッファ2601Wに画像処理画像データを記憶(保存)するための記憶容量に空きがあることを示し、「フル」は、ライトバッファ2601Wに画像処理画像データを記憶(保存)するための記憶容量に空きがないことを示している。例えば、リードライト切り替え制御部2603が、ライトDMA転送によってDRAM30に記憶させる(書き込む)のに十分なデータ量の画像処理画像データ(静止画像データや動画像データ)がライトバッファ2601Wに記憶(保存)されていることを観測した場合には、「ライトバッファ」の項目は「フル」となる。一方、リードライト切り替え制御部2603が、ライトDMA転送によってDRAM30に記憶させる(書き込む)のに十分なデータ量の画像処理画像データ(静止画像データや動画像データ)がライトバッファ2601Wに記憶(保存)されていることを観測できない場合には、「ライトバッファ」の項目は「エンプティ」となる。
 また、図3に示したDMA転送の状態をまとめた表の「リードアクセス要求」および「ライトアクセス要求」の項目において、「あり」は、それぞれのDMA転送の要求がバスマスタ2601からバスアービタ230に出力されていることを示し、「-」は、バスマスタ2601から出力されるそれぞれのDMA転送の要求の有無を考慮しないことを示している。
 リードライト切り替え制御部2603は、図3に示したDMA転送の状態をまとめた表の「リードバッファ」、「ライトバッファ」、「リードアクセス要求」、および「ライトアクセス要求」のそれぞれの項目に関して観測したバスマスタ2601におけるDMA転送の状態に基づいて、画像処理モジュール2602が実行する画像処理が待たされている状態か否かを判定するステップS110の処理を行う。
 より具体的には、観測したDMA転送の状態が、図3の1段目に示したように、リードDMA転送のアクセス要求を出力し、リードバッファ2601Rとライトバッファ2601Wとのそれぞれが「エンプティ」である場合、リードライト切り替え制御部2603は、バスマスタ2601が、リードDMA転送のアクセス要求の受け付け(許可)を待っている状態であると判定する。この場合、リードライト切り替え制御部2603は、画像処理モジュール2602が、画像処理を行うために必要な前処理画像データがリードバッファ2601Rに揃うのを待っている状態で画像処理が停止していると判定する。
 一方、観測したDMA転送の状態が、図3の4段目に示したように、ライトDMA転送のアクセス要求を出力し、リードバッファ2601Rとライトバッファ2601Wとのそれぞれが「フル」である場合、リードライト切り替え制御部2603は、バスマスタ2601が、ライトDMA転送のアクセス要求の受け付け(許可)を待っている状態であると判定する。この場合、リードライト切り替え制御部2603は、画像処理モジュール2602が、画像処理を行った後の画像処理画像データをライトバッファ2601Wに出力することができるようになるのを待っている状態で画像処理が停止していると判定する。
 なお、観測したDMA転送の状態が、図3の2段目または3段目に示したように、リードバッファ2601Rおよびライトバッファ2601Wのいずれか一方が「エンプティ」であり、他方が「フル」である場合、リードライト切り替え制御部2603は、画像処理モジュール2602が通常の動作を行っている状態であると判定する。つまり、リードライト切り替え制御部2603は、画像処理モジュール2602が、画像処理の実行を待たされている状態ではない(待ちの状態で画像処理が停止していない)と判定する。
 続いて、ステップS120においてデータバス210の混雑度を判定する方法について説明する。上述したように、リードライト切り替え制御部2603は、バスマスタ2601が行うリードDMA転送におけるリードアクセスの要求、およびリードアクセスの要求の受け付け(許可)と、ライトDMA転送におけるライトアクセスの要求、およびライトアクセスの要求の受け付け(許可)とのそれぞれを、バスマスタ2601が行うDMA転送の状態として観測する。リードライト切り替え制御部2603は、バスマスタ2601がDMA転送のアクセス要求をバスアービタ230に出力したときから、出力したアクセス要求がバスアービタ230によって受け付けられた(許可された)ときまでの時間に基づいて、データバス210の混雑度が予め定めた混雑度よりも大きいか否かを判定するステップS120の処理を行う。このとき、リードライト切り替え制御部2603は、観測したバスマスタ2601がアクセス要求を出力したときから、出力したアクセス要求がバスアービタ230によって受け付けられた(許可された)ときまでの時間を、予め定め設定された混雑度を判定するためのアクセス受け付け間隔の時間(以下、「混雑判定用アクセス受け付け間隔時間」という)と比較する。つまり、リードライト切り替え制御部2603は、バスマスタ2601がアクセス要求を出力した時間と、出力したアクセス要求がバスアービタ230によって受け付けられた(許可された)時間との差分の時間を算出し、算出した差分の時間と混雑判定用アクセス受け付け間隔時間と比較する。
 なお、リードライト切り替え制御部2603がステップS120において比較する混雑判定用アクセス受け付け間隔時間は、例えば、データバス210を介してDRAM30を共有する処理ブロックの数や、DRAM30におけるデータの入出力の仕様などに基づいて予め定めた時間のパラメータである。混雑判定用アクセス受け付け間隔時間は、CPU220が、バスマスタ2601がアクセス要求をバスアービタ230に出力したときから、出力したアクセス要求がバスアービタ230によって受け付けられた(許可された)ときまでの時間のパラメータとして、リードライト切り替え制御部2603のレジスタに予め設定している。
 リードライト切り替え制御部2603は、観測したバスマスタ2601がアクセス要求を出力した時間からアクセス要求が受け付けられた(許可された)時間までの差分の時間が、設定された混雑判定用アクセス受け付け間隔時間以内である場合には、データバス210の混雑度は、予め定めた混雑度よりも大きくないと判定する。一方、リードライト切り替え制御部2603は、観測したバスマスタ2601がアクセス要求を出力した時間からアクセス要求が受け付けられた(許可された)時間までの差分の時間が、設定された混雑判定用アクセス受け付け間隔時間よりも長い場合には、データバス210の混雑度は、予め定めた混雑度よりも大きいと判定する。
 そして、リードライト切り替え制御部2603は、ステップS110およびステップS120の処理によって判定した結果に基づいて、ステップS130における第1の切り替え閾値の生成の処理、またはステップS140における第2の切り替え閾値の生成の処理を行う。ここで、ステップS130における第1の切り替え閾値の生成の処理、およびステップS140における第2の切り替え閾値の生成の処理において生成する切り替え閾値について説明する。
 まず、リードライト切り替え制御部2603がステップS130の処理によって生成する第1の切り替え閾値について説明する。第1の切り替え閾値は、リードバッファ2601Rに画像処理モジュール2602に出力することができるデータ量の前処理画像データが記憶(保存)されたときと、ライトバッファ2601WにライトDMA転送することができるデータ量の画像処理画像データが記憶(保存)されたときとを基準として、優先して行いたいDMA転送を切り替えるための切り替え閾値である。このため、第1の切り替え閾値は、リードバッファ2601Rに対応する第1の切り替え閾値(以下「第1のリード切り替え閾値」という)と、ライトバッファ2601Wに対応する第1の切り替え閾値(以下「第1のライト切り替え閾値」という)とによって構成されている。
 リードライト切り替え制御部2603は、第1のリード切り替え閾値を、下式(1)によって算出する。また、リードライト切り替え制御部2603は、第1のライト切り替え閾値を、下式(2)によって算出する。
 第1のリード切り替え閾値
  =画像処理開始可能データ量+WR切り替えロス時間処理量
                           ・・・(1)
 第1のライト切り替え閾値
  =DMA転送開始可能データ量-RW切り替えロス時間処理量
                           ・・・(2)
 上式(1)において、画像処理開始可能データ量は、画像処理モジュール2602がリードバッファ2601Rから読み出して画像処理を開始することができる前処理画像データのデータ量(例えば、画素数)である。また、上式(1)において、WR切り替えロス時間処理量は、DRAM30の状態を、データを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な所定(一定)の時間のロス時間の間に、画像処理モジュール2602がリードバッファ2601Rから読み出して画像処理を行うことができる前処理画像データのデータ量(例えば、画素数)である。
 なお、リードライト切り替え制御部2603が第1のリード切り替え閾値を算出するための画像処理開始可能データ量とWR切り替えロス時間処理量とは、第1のリード切り替え閾値を算出するためのパラメータとして、CPU220によって、リードライト切り替え制御部2603のレジスタに設定されている。
 また、上式(2)において、DMA転送開始可能データ量は、バスマスタ2601がライトバッファ2601Wから読み出してライトDMA転送を開始することができる画像処理画像データのデータ量(例えば、画素数)である。また、上式(2)において、RW切り替えロス時間処理量は、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替えるときに必要な所定(一定)の時間のロス時間の間に、画像処理モジュール2602が画像処理を行ってライトバッファ2601Wに記憶(保存)させることができる画像処理画像データのデータ量(例えば、画素数)である。
 なお、リードライト切り替え制御部2603が第1のライト切り替え閾値を算出するためのDMA転送開始可能データ量とRW切り替えロス時間処理量とは、第1のライト切り替え閾値を算出するためのパラメータとして、CPU220によって、リードライト切り替え制御部2603のレジスタに設定されている。
 このように、リードライト切り替え制御部2603は、ステップS130の処理において、DRAM30の状態を切り替えるときに必要な所定(一定)の時間のロス時間の間に画像処理やDMA転送をすることができるデータ量を考慮した第1の切り替え閾値を生成する。そして、リードライト切り替え制御部2603は、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量と、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量とを、第1のリード切り替え閾値と第1のライト切り替え閾値とに基づいて判定し、優先して行いたいDMA転送を切り替えるリードライト切り替え信号RWを生成してバスアービタ230に出力する。より具体的には、リードライト切り替え制御部2603は、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量が、第1のリード切り替え閾値に到達したときに、リードDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。つまり、リードライト切り替え制御部2603は、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量が、第1のリード切り替え閾値以下になったときに、リードDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。また、リードライト切り替え制御部2603は、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量が、第1のライト切り替え閾値に到達したときに、ライトDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。つまり、リードライト切り替え制御部2603は、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量が、第1のライト切り替え閾値以上になったときに、ライトDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。
 続いて、リードライト切り替え制御部2603がステップS140の処理によって生成する第2の切り替え閾値について説明する。第2の切り替え閾値は、リードバッファ2601Rに記憶(保存)された前処理画像データが画像処理モジュール2602に全て出力されるときと、ライトバッファ2601Wに記憶(保存)することができる画像処理画像データがなくなるときとを基準として、優先して行いたいDMA転送を切り替えるための切り替え閾値である。つまり、第2の切り替え閾値は、リードバッファ2601Rの記憶容量が全て空きの状態になるときと、ライトバッファ2601Wの記憶容量が満杯になる状態のときとを基準とした切り替え閾値である。このため、第2の切り替え閾値も、第1の切り替え閾値と同様に、リードバッファ2601Rに対応する第2の切り替え閾値(以下「第2のリード切り替え閾値」という)と、ライトバッファ2601Wに対応する第2の切り替え閾値(以下「第2のライト切り替え閾値」という)とによって構成されている。
 リードライト切り替え制御部2603は、第2のリード切り替え閾値を、下式(3)によって算出する。また、リードライト切り替え制御部2603は、第2のライト切り替え閾値を、下式(4)によって算出する。
 第2のリード切り替え閾値
  =WR切り替えロス時間処理量+DMA転送中処理可能データ量
                           ・・・(3)
 第2のライト切り替え閾値
  =記憶容量-RW切り替えロス時間処理量
                           ・・・(4)
 上式(3)において、WR切り替えロス時間処理量は、上式(1)において第1のリード切り替え閾値を算出するためのWR切り替えロス時間処理量と同じものである。また、上式(3)において、DMA転送中処理可能データ量は、バスマスタ2601がDRAM30から前処理画像データをリードDMA転送によって取得して(読み出して)リードバッファ2601Rの全ての記憶容量に記憶(保存)するまでの間に、画像処理モジュール2602がリードバッファ2601Rから読み出して画像処理を行うことができる前処理画像データのデータ量(例えば、画素数)である。
 なお、リードライト切り替え制御部2603が第2のリード切り替え閾値を算出するためのWR切り替えロス時間処理量とDMA転送中処理可能データ量とは、第2のリード切り替え閾値を算出するためのパラメータとして、CPU220によって、リードライト切り替え制御部2603のレジスタに設定されている。
 また、上式(4)において、記憶容量は、ライトバッファ2601Wの記憶容量、つまり、ライトバッファ2601Wに記憶(保存)することができる画像処理画像データのデータ量(例えば、画素数)である。また、上式(4)において、RW切り替えロス時間処理量は、上式(2)において第1のライト切り替え閾値を算出するためのRW切り替えロス時間処理量と同じものである。
 なお、リードライト切り替え制御部2603が第2のライト切り替え閾値を算出するための記憶容量とRW切り替えロス時間処理量とは、第2のライト切り替え閾値を算出するためのパラメータとして、CPU220によって、リードライト切り替え制御部2603のレジスタに設定されている。
 このように、リードライト切り替え制御部2603は、ステップS140の処理において、リードバッファ2601Rとライトバッファ2601Wとの記憶容量を考慮した第2の切り替え閾値を生成する。そして、リードライト切り替え制御部2603は、第1の切り替え閾値を用いたときと同様に、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量と、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量とを、第2のリード切り替え閾値と第2のライト切り替え閾値とに基づいて判定し、リードライト切り替え信号RWを生成してバスアービタ230に出力する。より具体的には、リードライト切り替え制御部2603は、第1の切り替え閾値を用いたときと同様に、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量が、第2のリード切り替え閾値に到達したときに、リードDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。つまり、リードライト切り替え制御部2603は、第1の切り替え閾値を用いたときと同様に、リードバッファ2601Rに記憶(保存)している前処理画像データのデータ量が、第2のリード切り替え閾値以下になったときに、リードDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。また、リードライト切り替え制御部2603は、第1の切り替え閾値を用いたときと同様に、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量が、第2のライト切り替え閾値に到達したときに、ライトDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。つまり、リードライト切り替え制御部2603は、第1の切り替え閾値を用いたときと同様に、ライトバッファ2601Wに記憶(保存)している画像処理画像データのデータ量が、第2のライト切り替え閾値以上になったときに、ライトDMA転送を優先することを通知するリードライト切り替え信号RWを、バスアービタ230に出力する。
 ここで、画像処理部260においてDMA転送を切り替え閾値に基づいて切り替える動作の一例について説明する。なお、一般的な撮像装置に備えた画像処理装置と同様に、撮像装置1に備えた画像処理装置20においても、画像処理部260の優先度は、前処理部250や表示処理部270よりも高くはない。つまり、画像処理部260がDRAM30へのアクセス要求を出力した場合でも、前処理部250や表示処理部270もDRAM30へのアクセス要求を出力している場合には、バスアービタ230は、前処理部250や表示処理部270のアクセス要求を受け付ける(許可する)ことになる。しかし、以下の説明においては、説明を容易にするため、画像処理部260のみがDRAM30へのアクセス要求をバスアービタ230に出力してDMA転送を行うものとして説明する。つまり、以下の説明においては、画像処理部260のみが、DRAM30から画像処理を施す対象の前処理画像データを取得する(読み出す)リードDMA転送と、画像処理を施した後の画像処理画像データをDRAM30に記憶させる(書き込む)ライトDMA転送とを行うものとして説明する。
 まず、画像処理部260におけるDMA転送を第1の切り替え閾値に基づいて切り替える動作について説明する。より具体的には、リードライト切り替え制御部2603が、第1の切り替え閾値に基づいてリードライト切り替え信号RWを変更して(切り替えて)、バスマスタ2601が行うリードDMA転送とライトDMA転送とを切り替える動作について説明する。図4は、本発明の第1の実施形態のメモリアクセス装置においてDMA転送を行うタイミングの一例を示したタイミングチャートである。
 図4には、バスマスタ2601に備えたリードバッファ2601Rとライトバッファ2601Wとのそれぞれに記憶(保存)しているデータ量の変移で、DMA転送を切り替える動作のタイミングの一例を示している。なお、図4においては、リードバッファ2601Rとライトバッファ2601Wとのそれぞれの構成が、予め定めたデータ量の画像データ(前処理画像データまたは画像処理画像データ)を記憶する記憶容量の組を2つ備えた、いわゆる、ダブルバッファの構成である場合のデータ量の変移を示している。つまり、図4においては、リードバッファ2601Rとライトバッファ2601Wとのそれぞれは、一方の記憶容量の組への画像データの書き込みと、他方の記憶容量の組からの画像データの読み出しとを交互に切り替えることによって、1回のDMA転送の単位で、画像データの入出力を同時期に行うことができる構成である場合のデータ量の変移を示している。なお、ダブルバッファの構成のリードバッファ2601Rとライトバッファ2601Wとのそれぞれの動作は、既存のダブルバッファの動作を制御する技術に基づいて容易に考えることができる。従って、ダブルバッファの構成のリードバッファ2601Rとライトバッファ2601Wとのそれぞれの動作に関する詳細な説明は省略する。
 また、図4には、リードライト切り替え制御部2603がバスアービタ230に出力するリードライト切り替え信号RWと、バスアービタ230によって受け付けられる(許可される)DMA転送とのそれぞれのタイミングの一例を示している。なお、図4においては、リードライト切り替え制御部2603が出力するリードライト切り替え信号RWが、“High”レベルでリードDMA転送を優先することを表し、“Low”レベルでライトDMA転送を優先することを表している。また、図4においてDMA転送のタイミングに示した“R”はリードDMA転送を表し、“W”はライトDMA転送を表している。
 画像処理部260が前処理画像データに対する画像処理を開始すると、バスマスタ2601は、まず、リードDMA転送によって、画像処理の対象の前処理画像データをDRAM30から取得する(読み出す)。このため、リードライト切り替え制御部2603は、リードDMA転送を優先することを通知する“High”レベルのリードライト切り替え信号RWを、バスアービタ230に出力する。これにより、バスアービタ230は、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、リードバッファ2601Rには、DRAM30から取得した(読み出した)前処理画像データが、順次記憶(保存)される。
 そして、リードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が、画像処理開始可能データ量以上になると、画像処理モジュール2602は、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行うことができるようになる。このとき、バスマスタ2601は、画像処理モジュール2602が画像処理を行うタイミングに合わせて、リードバッファ2601Rに記憶(保存)した前処理画像データを、画像処理モジュール2602に出力する。これにより、リードバッファ2601Rに記憶(保存)された前処理画像データのデータ量は、画像処理モジュール2602に出力した分だけ少なくなっていく。
 そして、画像処理モジュール2602は、バスマスタ2601から出力された前処理画像データに対して画像処理を行って生成した画像処理画像データを、バスマスタ2601に出力して、ライトバッファ2601Wに記憶(保存)する。図4に示したタイミングチャートの一例では、タイミングt1から、画像処理モジュール2602が出力した画像処理画像データが、ライトバッファ2601Wに順次記憶(保存)され、ライトバッファ2601Wにおける画像処理画像データのデータ量は増えていく。
 その後、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が、第1のライト切り替え閾値以上になったタイミングt2のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。これにより、バスアービタ230は、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。そして、バスマスタ2601は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt3から、ライトDMA転送によって、ライトバッファ2601Wに記憶(保存)された画像処理画像データをDRAM30に記憶させる(書き込む)。
 このように、リードライト切り替え制御部2603は、第1のライト切り替え閾値に基づいて、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量がDMA転送開始可能データ量になる前のタイミングt2のときに、リードライト切り替え信号RWを変更する。なお、画像処理モジュール2602は、タイミングt2以降も、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行っている。従って、バスマスタ2601がライトDMA転送を開始する、つまり、DRAM30において切り替えに必要な所定の時間(一定時間)のロス時間が経過するタイミングt3までには、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量がDMA転送開始可能データ量となる。これにより、バスマスタ2601は、ライトバッファ2601Wの記憶容量が満杯になるまで画像処理画像データが記憶(保存)されるのを待つことなく、タイミングt3からライトDMA転送を開始することができる。このことにより、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量は、DRAM30に記憶された(書き込まれた)分だけ少なくなっていく。
 なお、画像処理モジュール2602は、タイミングt3以降も、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行っている。このため、図4に示したタイミングチャートの一例のように、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量は、画像処理モジュール2602が画像処理を終了した分だけ増えていく。
 そして、リードライト切り替え制御部2603が観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量は、タイミングt4のときに、再び第1のライト切り替え閾値以上になる。ここで、図4に示したタイミングチャートの一例では、タイミングt4のときに、リードライト切り替え制御部2603が観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が、第1のリード切り替え閾値以下になっている。このため、リードライト切り替え制御部2603は、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。この場合、リードライト切り替え制御部2603は、画像処理部260において予め定めた、バスマスタ2601が行うリードDMA転送とライトDMA転送との間の優先度に基づいて、優先して行うDMA転送を決定する。なお、画像処理部260では、バスマスタ2601が行うリードDMA転送の方が、ライトDMA転送よりも優先度が高くなっている。このため、図4に示したタイミングチャートの一例では、リードライト切り替え制御部2603が、タイミングt4のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにしている。これにより、バスアービタ230は、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを書き込んでいる状態からデータを読み出す状態に切り替える。そして、バスマスタ2601は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt5から、リードDMA転送によって、DRAM30から前処理画像データを取得し(読み出し)、リードバッファ2601Rに記憶(保存)する。
 このように、リードライト切り替え制御部2603は、第1のリード切り替え閾値に基づいて、リードバッファ2601Rに記憶(保存)された前処理画像データが画像処理開始可能データ量よりも少なくなる前のタイミングt4のときに、リードライト切り替え信号RWを変更する。これにより、図4に示したタイミングチャートの一例のように、タイミングt5から、DRAM30から取得した(読み出した)前処理画像データが、リードバッファ2601Rに順次記憶(保存)され、リードバッファ2601Rにおける前処理画像データのデータ量は増えていく。そして、画像処理モジュール2602は、リードバッファ2601Rに必要な前処理画像データが記憶(保存)されるのを待つことなく、前処理画像データに対する画像処理を継続することができる。
 なお、リードDMA転送とライトDMA転送とのいずれのDMA転送を優先するかを決定する方法は、上述したような、画像処理部260において予め定めた優先度に基づいた方法に限定されるものではない。例えば、リードライト切り替え制御部2603は、画像処理モジュール2602が実行する画像処理が待たされて停止している状態が発生しないように、観測したDMA転送の状態に基づいて、優先して行うDMA転送を決定してもよい。より具体的には、上述したように、画像処理が待たされる状態は、画像処理モジュール2602が画像処理を行うために必要な前処理画像データがリードバッファ2601Rに揃うのを待つ状態と、画像処理モジュール2602が画像処理を行った後の画像処理画像データをライトバッファ2601Wに出力することができるようになるのを待つ状態とがある。この場合、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量と、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量とに基づいて、上記の2つの画像処理が待たされる状態の内、その状態が早く訪れる方の要因を先になくすように、優先して行うDMA転送を決定してもよい。図4に示したタイミングチャートの一例では、画像処理モジュール2602がリードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行ってライトバッファ2601Wの記憶容量が満杯になるまで画像処理画像データを記憶(保存)させるのに要する時間よりも、バスマスタ2601がリードDMA転送によって前処理画像データをDRAM30から取得する(読み出す)のに要する時間の方が短い。このため、画像処理モジュール2602が画像処理を行うために必要な前処理画像データがリードバッファ2601Rに揃うのを待つ状態の方が、画像処理モジュール2602が画像処理を行った後の画像処理画像データをライトバッファ2601Wに出力することができるようになるのを待つ状態よりも早く訪れる。このことから、リードライト切り替え制御部2603は、より早く完了するリードDMA転送を、優先して行うDMA転送として決定する。
 なお、リードライト切り替え制御部2603は、タイミングt5からリードDMA転送が開始されると、タイミングt4のときに再び第1のライト切り替え閾値以上になったライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量に応じて、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。これにより、バスアービタ230は、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。図4に示したタイミングチャートの一例では、バスマスタ2601によるリードDMA転送が終了したタイミングt6のときに、バスマスタ2601から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替えている。これにより、バスマスタ2601は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt7から、ライトDMA転送を開始することができる。
 その後、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が、再び第1のライト切り替え閾値以上になったタイミングt8のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。ただし、図4に示したタイミングチャートの一例では、タイミングt8よりも前のタイミングから、リードライト切り替え信号RWは“Low”レベルである。つまり、DRAM30の状態は、すでにデータを書き込む状態である。このため、バスマスタ2601は、ライトバッファ2601WにDMA転送開始可能データ量まで画像処理画像データが記憶(保存)されたタイミングt9から、すぐにライトDMA転送を開始することができる。
 タイミングt9以降も同様に、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量と、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量とに基づいて、リードライト切り替え信号RWを変更する。より具体的には、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が第1のリード切り替え閾値以下になったときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにする。また、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が第1のライト切り替え閾値以上になったときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。
 図4に示したタイミングチャートの一例では、タイミングt10のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“High”レベルにして、タイミングt11~タイミングt13の間にリードDMA転送を行うタイミングを示している。また、図4に示したタイミングチャートの一例では、タイミングt12のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“Low”レベルにして、タイミングt14からライトDMA転送を行い、タイミングt15のときのリードライト切り替え信号RWの“Low”レベルに応じてタイミングt16からすぐにライトDMA転送を行うタイミングを示している。
 また、図4に示したタイミングチャートの一例では、タイミングt17のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“High”レベルにして、タイミングt18~タイミングt20の間にリードDMA転送を行うタイミングを示している。また、図4に示したタイミングチャートの一例では、タイミングt19のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“Low”レベルにして、タイミングt21からライトDMA転送を行い、タイミングt22のときのリードライト切り替え信号RWの“Low”レベルに応じてタイミングt23からすぐにライトDMA転送を行うタイミングを示している。
 また、図4に示したタイミングチャートの一例では、タイミングt24のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“High”レベルにして、タイミングt25~タイミングt27の間にリードDMA転送を行うタイミングを示している。また、図4に示したタイミングチャートの一例では、タイミングt26のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“Low”レベルにして、ライトDMA転送を優先することを通知するタイミングを示している。
 続いて、画像処理部260におけるDMA転送を第2の切り替え閾値に基づいて切り替える動作について説明する。より具体的には、リードライト切り替え制御部2603が、第2の切り替え閾値に基づいてリードライト切り替え信号RWを変更して(切り替えて)、バスマスタ2601が行うリードDMA転送とライトDMA転送とを切り替える動作について説明する。図5は、本発明の第1の実施形態のメモリアクセス装置においてDMA転送を行う別のタイミングの一例を示したタイミングチャートである。
 図5には、図4に示した第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様に、バスマスタ2601に備えたリードバッファ2601Rとライトバッファ2601Wとのそれぞれに記憶(保存)しているデータ量の変移で、DMA転送を切り替える動作のタイミングの一例を示している。なお、図5においても、図4に示したタイミングチャートの一例と同様に、リードバッファ2601Rとライトバッファ2601Wとのそれぞれの構成がダブルバッファの構成である場合のデータ量の変移を示している。
 また、図5には、図4に示したタイミングチャートの一例と同様に、リードライト切り替え制御部2603がバスアービタ230に出力するリードライト切り替え信号RWと、バスアービタ230によって受け付けられる(許可される)DMA転送とのそれぞれのタイミングの一例を示している。なお、図5においても、リードライト切り替え信号RWが表すレベル、およびDMA転送のタイミングは、図4に示したタイミングチャートの一例と同様である。
 画像処理部260が前処理画像データに対する画像処理を開始すると、図4に示したタイミングチャートの一例と同様に、バスマスタ2601は、まず、リードDMA転送によって、画像処理の対象の前処理画像データをDRAM30から取得する(読み出す)。このため、リードライト切り替え制御部2603は、リードDMA転送を優先することを通知する“High”レベルのリードライト切り替え信号RWを、バスアービタ230に出力する。これにより、図4に示したタイミングチャートの一例と同様に、リードバッファ2601Rには、DRAM30から取得した(読み出した)前処理画像データが、順次記憶(保存)される。
 そして、リードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が、画像処理開始可能データ量以上になると、図4に示したタイミングチャートの一例と同様に、画像処理モジュール2602は、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行うことができるようになる。これにより、画像処理モジュール2602は、図4に示したタイミングチャートの一例と同様に、バスマスタ2601から出力された前処理画像データに対して画像処理を行って生成した画像処理画像データを、バスマスタ2601に出力して、ライトバッファ2601Wに記憶(保存)する。図5に示したタイミングチャートの一例では、図4に示したタイミングチャートの一例と同様に、タイミングt1から、画像処理モジュール2602が出力した画像処理画像データが、ライトバッファ2601Wに順次記憶(保存)され、ライトバッファ2601Wにおける画像処理画像データのデータ量は増えていく。このとき、リードバッファ2601Rに記憶(保存)された前処理画像データのデータ量も、図4に示したタイミングチャートの一例と同様に、画像処理モジュール2602に出力した分だけ少なくなっていく。
 その後、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が、第2のライト切り替え閾値以上になったタイミングt2のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。これにより、バスアービタ230は、図4に示したタイミングチャートの一例と同様に、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。そして、バスマスタ2601は、図4に示したタイミングチャートの一例と同様に、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt3から、ライトDMA転送によって、ライトバッファ2601Wに記憶(保存)された画像処理画像データをDRAM30に記憶させる(書き込む)。
 このように、リードライト切り替え制御部2603は、第2のライト切り替え閾値に基づいて、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量がフルの状態、つまり、ライトバッファ2601Wの記憶容量が満杯の状態になる前のタイミングt2のときに、リードライト切り替え信号RWを変更する。なお、画像処理モジュール2602は、図4に示したタイミングチャートの一例と同様に、タイミングt2以降も、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行っている。従って、バスマスタ2601がライトDMA転送を開始する、つまり、DRAM30において切り替えに必要な所定の時間(一定時間)のロス時間が経過するタイミングt3までには、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量がフルの状態となる。これにより、バスマスタ2601は、ライトバッファ2601Wの記憶容量が満杯になるまで画像処理画像データが記憶(保存)されるのを待つことなく、タイミングt3からライトDMA転送を開始することができる。このことにより、図4に示したタイミングチャートの一例と同様に、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量は、DRAM30に記憶された(書き込まれた)分だけ少なくなっていく。
 なお、画像処理モジュール2602は、タイミングt3以降も、図4に示したタイミングチャートの一例と同様に、リードバッファ2601Rに記憶(保存)された前処理画像データを読み出して画像処理を行っている。このため、図5に示したタイミングチャートの一例のように、ライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量は、画像処理モジュール2602が画像処理を終了した分だけ増えていく。
 その後、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が、第2のリード切り替え閾値以下になったタイミングt4のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにする。これにより、バスアービタ230は、画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2601から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを書き込んでいる状態からデータを読み出す状態に切り替える。そして、バスマスタ2601は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt5から、リードDMA転送によって、DRAM30から前処理画像データを取得し(読み出し)、リードバッファ2601Rに記憶(保存)する。
 このように、リードライト切り替え制御部2603は、第2のリード切り替え閾値に基づいて、リードバッファ2601Rに記憶(保存)された前処理画像データが空の状態、つまり、リードバッファ2601Rの記憶容量が全て空きの状態になる前のタイミングt4のときに、リードライト切り替え信号RWを変更する。これにより、図5に示したタイミングチャートの一例のように、タイミングt5から、DRAM30から取得した(読み出した)前処理画像データが、リードバッファ2601Rに順次記憶(保存)され、リードバッファ2601Rにおける前処理画像データのデータ量は増えていく。そして、画像処理モジュール2602は、リードバッファ2601Rに必要な前処理画像データが記憶(保存)されるのを待つことなく、前処理画像データに対する画像処理を継続することができる。
 その後、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が、第2のライト切り替え閾値以上になったタイミングt6のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。ただし、図5に示したタイミングチャートの一例では、タイミングt6のときは、バスアービタ230に先に受け付けられた(許可された)リードDMA転送を行っている途中である。このため、バスアービタ230が画像処理部260をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するタイミングは、早くとも、リードDMA転送が終了するタイミングt7以降である。つまり、バスマスタ2601が次のDMA転送を開始することができるようになるタイミングは、タイミングt7以降である。また、バスアービタ230が受け付ける(許可する)アクセス要求は、ライトDMA転送のアクセス要求である。このため、バスアービタ230は、バスマスタ2601から出力されたライトDMA転送のアクセス要求を受け付ける(許可する)際に、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。従って、バスマスタ2601は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt8から、ライトDMA転送を開始することになる。このため、画像処理モジュール2602は、リードDMA転送が終了するタイミングt7からDRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過するタイミングt8までの間、実行する画像処理が待たされている状態となる。
 その後、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が、再び第2のライト切り替え閾値以上になったタイミングt9のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。ただし、図5に示したタイミングチャートの一例でも、図4に示したタイミングチャートの一例と同様に、タイミングt9よりも前のタイミングから、リードライト切り替え信号RWは“Low”レベルであり、DRAM30の状態は、すでにデータを書き込む状態である。このため、バスマスタ2601は、ライトバッファ2601Wにフルの状態まで画像処理画像データが記憶(保存)されたタイミングt10から、すぐにライトDMA転送を開始することができる。
 タイミングt10以降も同様に、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量と、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量とに基づいて、リードライト切り替え信号RWを変更する。より具体的には、リードライト切り替え制御部2603は、観測したリードバッファ2601Rに記憶(保存)された前処理画像データのデータ量が第2のリード切り替え閾値以下になったときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにする。また、リードライト切り替え制御部2603は、観測したライトバッファ2601Wに記憶(保存)された画像処理画像データのデータ量が第2のライト切り替え閾値以上になったときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。
 図5に示したタイミングチャートの一例では、タイミングt11のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“High”レベルにして、タイミングt12~タイミングt13の間にリードDMA転送を行うタイミングを示している。また、図5に示したタイミングチャートの一例では、タイミングt13のときに、リードライト切り替え制御部2603がリードライト切り替え信号RWを“Low”レベルにして、タイミングt14からライトDMA転送を行うタイミングを示している。
 このような構成および動作によって、第1の実施形態のメモリアクセス装置では、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2603がバスマスタ2601によるDMA転送の状態を観測して、優先して行いたいDMA転送を通知するためのリードライト切り替え信号RWを、バスアービタ230に出力する。このとき、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が、第1の切り替え閾値または第2の切り替え閾値に基づいて、バスマスタ2601に備えたリードバッファ2601Rまたはライトバッファ2601Wに記憶(保存)された画像データ(前処理画像データまたは画像処理画像データ)のデータ量を判定して、早いタイミングでリードライト切り替え信号RWを変更する。つまり、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が、リードバッファ2601Rおよびライトバッファ2601Wの記憶容量にある程度の余裕をもった状態で、リードライト切り替え信号RWを変更する。そして、第1の実施形態のメモリアクセス装置では、バスアービタ230が、バスマスタ2601からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知されたDMA転送のアクセス要求を受け付ける(許可する)。これにより、第1の実施形態のメモリアクセス装置では、DRAM30におけるデータを読み出している状態からデータを書き込む状態への切り替えや、データを書き込んでいる状態からデータを読み出す状態への切り替えを、適切に行うことができる。つまり、第1の実施形態のメモリアクセス装置では、DRAM30の状態を、データを読み出している状態からデータを書き込む状態への切り替えるときや、データを書き込んでいる状態からデータを読み出す状態への切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。このことにより、第1の実施形態のメモリアクセス装置では、画像処理モジュール2602による一連の画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。そして、第1の実施形態のメモリアクセス装置を搭載したシステム(撮像装置1や画像処理装置20)では、システムに破綻をきたす要因となり得る、データバス210における画像データの転送効率の低下を少なくする(抑える)ことができる。
 なお、図4および図5では、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いてリードライト切り替え信号RWを変更し(切り替え)、バスマスタ2601が行うリードDMA転送とライトDMA転送とを切り替える動作について説明した。しかし、画像処理部260におけるDMA転送を切り替える動作は、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いる動作に限定されるものではなく、第1の切り替え閾値と第2の切り替え閾値との両方の切り替え閾値を用いて、バスマスタ2601が行うリードDMA転送とライトDMA転送とを切り替えてもよい。つまり、リードライト切り替え制御部2603は、第1の切り替え閾値と第2の切り替え閾値との両方の切り替え閾値を用いた2段階で、バスマスタ2601に備えたリードバッファ2601Rとライトバッファ2601Wとのそれぞれに記憶(保存)しているデータ量を判定し、優先して行いたいDMA転送を通知するリードライト切り替え信号RWの状態を変更する構成であってもよい。なお、この場合においてバスマスタ2601が行うリードDMA転送とライトDMA転送とを切り替える動作は、図4に示した第1の切り替え閾値に基づいてDMA転送を切り替える動作と、図5に示した第2の切り替え閾値に基づいてDMA転送を切り替える動作とから容易に理解することができるため、詳細な説明は省略する。
 第1の実施形態によれば、データバス(データバス210)に接続されたメモリ(DRAM30)へのアクセスを要求するアクセス要求を出力するバスマスタ(バスマスタ2601)と、バスマスタ2601がアクセスするDRAM30のデータに対する処理の停止を予測し、バスマスタ2601におけるアクセス要求の内、DRAM30からデータを読み出すリードアクセスを要求するリードアクセス要求(リードアクセスのDMA転送:リードDMA転送)と、DRAM30にデータを書き込むライトアクセスを要求するライトアクセス要求(ライトアクセスのDMA転送:ライトDMA転送)とのいずれのアクセス要求(DMA転送)を優先するかを通知するリードライト切り替え制御部(リードライト切り替え制御部2603)と、データバス210に接続され、DRAM30へのDMA転送を調停し、バスマスタ2601から出力されたDRAM30へのDMA転送を受け付ける際に、リードライト切り替え制御部2603によって通知された優先するDMA転送を受け付け、受け付けたDMA転送に応じてDRAM30へのアクセスを制御するバスアービタ(バスアービタ230)と、を備える、メモリアクセス装置(メモリアクセス装置)が構成される。
 また、第1の実施形態によれば、リードライト切り替え制御部2603は、バスマスタ2601から出力されたリードDMA転送の状態と、バスマスタ2601から出力されたライトアクセスのDMA転送の状態と、バスマスタ2601に備えた、DRAM30から読み出した予め定めたデータ量のデータを保存するリードバッファ(リードバッファ2601R)に保存されたデータ(前処理画像データ)のデータ量と、バスマスタ2601に備えた、DRAM30に書き込む予め定めたデータ量のデータを保存するライトバッファ(ライトバッファ2601W)に保存されたデータ(画像処理画像データ(静止画像データや動画像データ))のデータ量と、を観測し、バスマスタ2601におけるDMA転送において、リードDMA転送とライトアクセスのDMA転送とのいずれのDMA転送を優先するかを通知するためのリードライト切り替え信号(リードライト切り替え信号RW)を出力し、バスアービタ230は、バスマスタ2601から出力されたDMA転送を受け付ける際に、リードライト切り替え信号RWによって通知された優先するDMA転送を受け付ける、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、リードライト切り替え制御部2603は、観測したそれぞれの状態に基づいて、リードDMA転送とライトアクセスのDMA転送とのいずれのDMA転送を優先するかを判定するための切り替え閾値を生成し、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量、およびライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量を、切り替え閾値(第1の切り替え閾値や第2の切り替え閾値)を用いて判定し、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量、またはライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量が、切り替え閾値に到達したと判定したときに、リードライト切り替え信号RWが表す優先するDMA転送を切り換える、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、切り替え閾値(第1の切り替え閾値)は、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量の判定に用いられ、リードバッファ2601Rに保存されたデータ(前処理画像データ)に対して処理(画像処理)を行う処理モジュール(画像処理モジュール2602)が、リードバッファ2601Rに保存されたデータ(前処理画像データ)を読み出して処理(画像処理)を開始することができるデータ量と、DRAM30をデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間(所定(一定)の時間のロス時間)の間に処理(画像処理)を行うことができるデータ量とを加えたリード切り替え閾値(第1のリード切り替え閾値)と、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量の判定に用いられ、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のDRAM30への書き込み(ライトDMA転送)を開始することができるデータ量から、DRAM30をデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間(所定(一定)の時間のロス時間)の間に画像処理モジュール2602が処理(画像処理)を行うことができるデータ量を引いたライト切り替え閾値(第1のライト切り替え閾値)と、から構成されている、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、切り替え閾値(第2の切り替え閾値)は、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量の判定に用いられ、リードバッファ2601Rに保存されたデータ(前処理画像データ)に対して処理を行う画像処理モジュール2602が、DRAM30をデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間(所定(一定)の時間のロス時間)に処理(画像処理)を行うことができるデータ量と、DRAM30から読み出したデータ(前処理画像データ)をリードバッファ2601Rの全ての記憶容量に保存するまでの間に処理(画像処理)を行うことができるデータ量とを加えたリード切り替え閾値(第2のリード切り替え閾値)と、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量の判定に用いられ、ライトバッファ2601Wに画像処理モジュール2602が処理(画像処理)を行った後のデータ(画像処理画像データ)を保存することができるデータ量(ライトバッファ2601Wの記憶容量)から、DRAM30をデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間(所定(一定)の時間のロス時間)に画像処理モジュール2602が処理(画像処理)を行うことができるデータ量を引いたライト切り替え閾値(第2のライト切り替え閾値)と、から構成されている、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、リードライト切り替え制御部2603は、観測したそれぞれの状態に基づいて、リードバッファ2601Rに保存されたデータ(前処理画像データ)を読み出して処理(画像処理)を行い、処理(画像処理)を行った後のデータ(画像処理画像データ)をライトバッファ2601Wに保存する画像処理モジュール2602に、処理(画像処理)が待たされている状態が発生しているか否かと、データバス210を介して受け渡しが行われているデータ(他の処理ブロックが生成した画像データを含む)のデータ量(データバス210の混雑度)が予め定めたデータ量(予め定めた混雑度)よりも多いか否かとを判定し、画像処理モジュール2602に処理が待たされている状態が発生していない、または、画像処理モジュール2602に処理が待たされている状態が発生しているが、データバス210を介して受け渡しが行われているデータのデータ量(データバス210の混雑度)が予め定めたデータ量(予め定めた混雑度)よりも多くないと判定した場合に、リードDMA転送とライトアクセスのDMA転送とのいずれのDMA転送を優先するかを判定するための第1の切り替え閾値を生成し、画像処理モジュール2602に処理が待たされている状態が発生しており、データバス210を介して受け渡しが行われているデータのデータ量(データバス210の混雑度)が予め定めたデータ量(予め定めた混雑度)よりも多いと判定した場合に、リードDMA転送とライトアクセスのDMA転送とのいずれのDMA転送を優先するかを判定するための第2の切り替え閾値を生成し、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量、およびライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量を、第1の切り替え閾値および第2の切り替え閾値のいずれか一方または両方を用いて判定し、リードバッファ2601Rに保存されたデータのデータ量(前処理画像データ)、またはライトバッファ2601Wに保存されたデータのデータ量(画像処理画像データ)が、判定に用いた切り替え閾値に到達したと判定したときに、リードライト切り替え信号RWが表す優先するDMA転送を切り換える、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、第1の切り替え閾値は、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量の判定に用いられ、画像処理モジュール2602が、リードバッファ2601Rに保存されたデータ(前処理画像データ)を読み出して処理(画像処理)を開始することができるデータ量と、DRAM30をデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間(所定(一定)の時間のロス時間)の間に処理(画像処理)を行うことができるデータ量とを加えた第1のリード切り替え閾値と、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量の判定に用いられ、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のDRAM30への書き込み(ライトDMA転送)を開始することができるデータ量から、DRAM30をデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間(所定(一定)の時間のロス時間)の間に画像処理モジュール2602が処理(画像処理)を行うことができるデータ量を引いた第1のライト切り替え閾値と、から構成され、第2の切り替え閾値は、リードバッファ2601Rに保存されたデータ(前処理画像データ)のデータ量の判定に用いられ、画像処理モジュール2602が、DRAM30をデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間(所定(一定)の時間のロス時間)の間に処理(画像処理)を行うことができるデータ量と、DRAM30から読み出したデータをリードバッファ2601Rの全ての記憶容量に保存するまでの間に処理(画像処理)を行うことができるデータ量とを加えた第2のリード切り替え閾値と、ライトバッファ2601Wに保存されたデータ(画像処理画像データ)のデータ量の判定に用いられ、ライトバッファ2601Wに画像処理モジュール2602が処理(画像処理)を行った後のデータ(画像処理画像データ)を保存することができるデータ量(ライトバッファ2601Wの記憶容量)から、DRAM30をデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に画像処理モジュール2602が処理(画像処理)を行うことができるデータ量を引いた第2のライト切り替え閾値と、から構成されている、メモリアクセス装置が構成される。
 また、第1の実施形態によれば、データバス(データバス210)に接続されたメモリ(DRAM30)へのアクセスを要求するアクセス要求を出力するバスマスタ(バスマスタ2601)と、バスマスタ2601がアクセスするDRAM30のデータに対する処理の停止を予測し、バスマスタ2601におけるアクセス要求の内、DRAM30からデータを読み出すリードアクセスを要求するリードアクセス要求(リードアクセスのDMA転送:リードDMA転送)と、DRAM30にデータを書き込むライトアクセスを要求するライトアクセス要求(ライトアクセスのDMA転送:ライトDMA転送)とのいずれのアクセス要求(DMA転送)を優先するかを通知するリードライト切り替え制御部(リードライト切り替え制御部2603)と、データバス210に接続され、DRAM30へのDMA転送を調停し、バスマスタ2601から出力されたDRAM30へのDMA転送を受け付ける際に、リードライト切り替え制御部2603によって通知された優先するDMA転送を受け付け、受け付けたDMA転送に応じてDRAM30へのアクセスを制御するバスアービタ(バスアービタ230)と、を具備したメモリアクセス装置(メモリアクセス装置)、を備える、画像処理装置(画像処理装置20)が構成される。
 また、第1の実施形態によれば、データバス(データバス210)に接続されたメモリ(DRAM30)へのアクセスを要求するアクセス要求を出力するバスマスタ(バスマスタ2601)と、バスマスタ2601がアクセスするDRAM30のデータに対する処理の停止を予測し、バスマスタ2601におけるアクセス要求の内、DRAM30からデータを読み出すリードアクセスを要求するリードアクセス要求(リードアクセスのDMA転送:リードDMA転送)と、DRAM30にデータを書き込むライトアクセスを要求するライトアクセス要求(ライトアクセスのDMA転送:ライトDMA転送)とのいずれのアクセス要求(DMA転送)を優先するかを通知するリードライト切り替え制御部(リードライト切り替え制御部2603)と、データバス210に接続され、DRAM30へのDMA転送を調停し、バスマスタ2601から出力されたDRAM30へのDMA転送を受け付ける際に、リードライト切り替え制御部2603によって通知された優先するDMA転送を受け付け、受け付けたDMA転送に応じてDRAM30へのアクセスを制御するバスアービタ(バスアービタ230)と、を具備したメモリアクセス装置(メモリアクセス装置)を備える画像処理装置(画像処理装置20)、を備える、撮像装置(撮像装置1)が構成される。
 上述したように、第1の実施形態のメモリアクセス装置では、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2603が、バスマスタ2601によるDMA転送の状態を観測する。そして、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が観測したバスマスタ2601によるDMA転送の状態に基づいて、読み出しのDMA転送(リードDMA転送)と書き込みのDMA転送(ライトDMA転送)との内、優先して行いたい方のDMA転送を通知するためのリードライト切り替え信号RWを、バスアービタ230に出力する。これにより、第1の実施形態のメモリアクセス装置では、DRAM30におけるデータを読み出している状態からデータを書き込む状態への切り替えや、データを書き込んでいる状態からデータを読み出す状態への切り替えを、適切に行うことができる。そして、第1の実施形態のメモリアクセス装置では、バスアービタ230が、バスマスタ2601からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)ことができる。
 また、第1の実施形態のメモリアクセス装置では、リードライト切り替え制御部2603が、第1の切り替え閾値または第2の切り替え閾値に基づいて、バスマスタ2601に備えたリードバッファ2601Rまたはライトバッファ2601Wに記憶(保存)された画像データ(前処理画像データまたは画像処理画像データ)のデータ量を判定して、早いタイミングでリードライト切り替え信号RWを変更する。そして、第1の実施形態のメモリアクセス装置では、バスアービタ230によってバスマスタ2601が出力したアクセス要求が受け付けられる(許可される)ときまでには、DMA転送に必要な状態が整っている。より具体的には、第1の実施形態のメモリアクセス装置では、バスアービタ230によってバスマスタ2601が出力したリードDMA転送のアクセス要求が受け付けられる(許可される)ときまでには、バスマスタ2601に備えたリードバッファ2601Rに、リードDMA転送によってDRAM30から取得する(読み出す)前処理画像データを記憶することができる量の記憶容量が確保できている。また、第1の実施形態のメモリアクセス装置では、バスアービタ230によってバスマスタ2601が出力したライトDMA転送のアクセス要求が受け付けられる(許可される)ときまでには、バスマスタ2601に備えたライトバッファ2601Wに、ライトDMA転送によってDRAM30に記憶させる(書き込む)画像処理画像データが揃っている。これにより、第1の実施形態のメモリアクセス装置では、画像処理モジュール2602による画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 これらのことにより、第1の実施形態のメモリアクセス装置を搭載したシステム(撮像装置1や画像処理装置20)では、DRAM30の状態を、データを読み出している状態からデータを書き込む状態への切り替えるときや、データを書き込んでいる状態からデータを読み出す状態への切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。つまり、第1の実施形態のメモリアクセス装置を搭載したシステムに破綻をきたす要因となり得る、データバス210における画像データの転送効率の低下を少なくする(抑える)ことができる。そして、第1の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602は、画像データに対する一連の画像処理を、円滑に行うことができる。
 なお、第1の実施形態のメモリアクセス装置では、1つのバスマスタ2601で、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う構成である場合について説明した。しかし、本発明のメモリアクセス装置におけるDRAM30との間で双方向のDMA転送を行うバスマスタの構成は、第1の実施形態のメモリアクセス装置に示した1つの構成に限定されるものではない。例えば、一方向のDMA転送を行うバスマスタを複数備えることによって、DRAM30との間で双方向のDMA転送を行うメモリアクセス装置を構成してもよい。より具体的には、DRAM30に対する書き込みのアクセス方向のDMA転送を行うバスマスタと、DRAM30に対する読み出しのアクセス方向のDMA転送を行うバスマスタとを1つずつ備えることによって、DRAM30との間で双方向のDMA転送を行うメモリアクセス装置を構成してもよい。
(第2の実施形態)
 次に、本発明の第2の実施形態のメモリアクセス装置について説明する。本発明の第2の実施形態のメモリアクセス装置は、メモリアクセス装置を構成するバスマスタが、書き込みのアクセス方向のDMA転送を行うバスマスタと、読み出しのアクセス方向のDMA転送を行うバスマスタとのそれぞれに分かれた構成である。なお、以下の説明においても、本発明の第2の実施形態のメモリアクセス装置が、例えば、静止画用カメラや動画用カメラなどの撮像装置に搭載されている画像処理装置に備えられている場合について説明する。
 図6は、本発明の第2の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。図6に示した第2の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の構成には、図1に示した第1の実施形態のメモリアクセス装置を備えた画像処理部260を搭載した撮像装置1と同様の構成要素を含んでいる。従って、第2の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の構成要素において、第1の実施形態のメモリアクセス装置を備えた画像処理部260を搭載した撮像装置1の構成要素と同様の構成要素には、同一の符号を付与し、それぞれの構成要素に関する詳細な説明は省略する。また、図6に示した第2の実施形態のメモリアクセス装置を備えた画像処理装置の構成には、図1に示した第1の実施形態のメモリアクセス装置を備えた画像処理部260と同様の構成要素を含んでいる。従って、第2の実施形態のメモリアクセス装置を備えた画像処理装置の構成要素において、第1の実施形態のメモリアクセス装置を備えた画像処理部260の構成要素と同様の構成要素には、同一の符号を付与し、それぞれの構成要素に関する詳細な説明は省略する。
 図6に示した撮像装置2は、イメージセンサ10と、画像処理装置21と、DRAM30と、表示装置40と、を備えている。また、画像処理装置21は、CPU220と、バスアービタ231と、DRAMインターフェース部240と、前処理部250と、画像処理部261と、表示処理部270と、を備えている。また、画像処理部261は、バスマスタ2611と、画像処理モジュール2602と、バスマスタ2613と、リードライト切り替え制御部2614と、を備えている。また、バスマスタ2611は、リードバッファ2611Rを備えている。また、バスマスタ2613は、ライトバッファ2613Wを備えている。画像処理装置21では、バスアービタ231と、前処理部250と、画像処理部261と、表示処理部270とのそれぞれが、共通のデータバス210に接続されている。
 なお、図6に示した撮像装置2では、画像処理装置21内の画像処理部261に備えたバスマスタ2611、バスマスタ2613、およびリードライト切り替え制御部2614と、バスアービタ231との構成が、第2の実施形態のメモリアクセス装置に相当する。
 撮像装置2も、図1に示した第1の実施形態における撮像装置1と同様に、イメージセンサ10によって被写体の静止画像または動画像を撮影し、撮影した静止画像または動画像に応じた表示画像を表示装置40に表示させる。なお、撮像装置2も、第1の実施形態における撮像装置1と同様に、撮影した静止画像や動画像に応じた記録画像を、不図示の記録媒体に記録させることもできる。
 画像処理装置21は、図1に示した第1の実施形態における画像処理装置20と同様に、イメージセンサ10から出力された画素信号に対して予め定めた画像処理を行って、静止画像や動画像を生成する。また、画像処理装置21は、第1の実施形態における画像処理装置20と同様に、生成した静止画像や動画像に応じた表示画像を生成し、生成した表示画像を表示装置40に表示させる。また、画像処理装置21は、第1の実施形態における画像処理装置20と同様に、生成した静止画像や動画像に応じた記録画像を生成し、生成した記録画像を不図示の記録媒体に記録させることもできる。
 画像処理装置21では、前処理部250と、画像処理部261と、表示処理部270とのそれぞれが、画像処理装置21において実行する画像処理の処理機能を実現する処理ブロックである。画像処理装置21では、前処理部250、画像処理部261、および表示処理部270のそれぞれが、データバス210を介したDMA転送によってDRAM30にアクセスする。
 バスアービタ231は、図1に示した第1の実施形態のメモリアクセス装置を構成するバスアービタ230と同様に、データバス210に接続されている画像処理装置21内のそれぞれの処理ブロックからのDMA転送によるDRAM30へのアクセス要求(DMA要求)を調停し、アクセス要求を受け付けた処理ブロックとの間でデータバス210を介したデータの受け渡しを行うDMA調停回路である。
 バスアービタ231も、第1の実施形態のメモリアクセス装置を構成するバスアービタ230と同様に、画像処理装置21に備えたそれぞれの処理ブロックの優先度に基づいて、アクセス要求信号(DMA要求信号)を出力してきたそれぞれの処理ブロックからのアクセス要求を受け付ける(許可する)。ただし、バスアービタ231は、画像処理部261から緊急度信号URが出力されている場合には、画像処理部261の優先度を高くして、画像処理部261からのアクセス要求を優先して受け付ける(許可する)。
 そして、バスアービタ231は、画像処理部261を、DRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定する場合には、第1の実施形態のメモリアクセス装置を構成するバスアービタ230と同様に、画像処理部261から出力されたリードライト切り替え信号RWに基づいて、受け付ける(許可する)DRAM30へのアクセス方向(書き込みまたは読み出し)を切り替える。
 画像処理部261は、図1に示した第1の実施形態における画像処理装置20に備えた画像処理部260と同様に、DRAM30に記憶された前処理画像データに対して予め定めた画像処理を施す処理ブロックである。画像処理部261でも、画像処理を施す対象の前処理画像データを取得する(読み出す)ためのDMA転送(リードDMA転送)と、画像処理を施して生成した画像データをDRAM30に記憶する(書き込む)ためのDMA転送(ライトDMA転送)とを行う。上述したように、画像処理部261は、バスマスタ2611と、画像処理モジュール2602と、バスマスタ2613と、リードライト切り替え制御部2614と、を備えている。
 バスマスタ2611は、画像処理モジュール2602が画像処理を行う対象の前処理画像データをDRAM30から取得する(読み出す)リードDMA転送を行うDMA転送部である。つまり、バスマスタ2611は、DRAM30との間で一方向(読み出し)のDMA転送を行うDMA転送部である。上述したように、バスマスタ2611は、リードバッファ2611Rを備えている。
 リードバッファ2611Rは、図1に示した第1の実施形態のメモリアクセス装置を構成するバスマスタ2601に備えたリードバッファ2601Rと同様に、予め定めたデータ量(例えば、画素数)の前処理画像データを一時的に記憶(保存)するデータ記憶部である。リードバッファ2611Rも、例えば、SRAMなどのメモリで構成される。
 バスマスタ2611は、DMA転送によってDRAM30から取得した(読み出した)前処理画像データを、リードバッファ2611Rに一時的に記憶(保存)し、予め定めたデータ量の前処理画像データを記憶(保存)した後に、画像処理モジュール2602からの要求に応じて、記憶(保存)している前処理画像データを画像処理モジュール2602に出力する。つまり、バスマスタ2611は、DMA転送によってDRAM30から取得した(読み出した)前処理画像データを、画像処理モジュール2602が画像処理を行うタイミングに合わせて、画像処理モジュール2602に出力する。
 バスマスタ2613は、画像処理モジュール2602が画像処理を行った後の画像処理画像データ(静止画像データや動画像データ)をDRAM30に記憶させる(書き込む)ライトDMA転送を行うDMA転送部である。つまり、バスマスタ2613は、DRAM30との間で一方向(書き込み)のDMA転送を行うDMA転送部である。上述したように、バスマスタ2613は、ライトバッファ2613Wを備えている。
 ライトバッファ2613Wは、図1に示した第1の実施形態のメモリアクセス装置を構成するバスマスタ2601に備えたライトバッファ2601Wと同様に、予め定めたデータ量(例えば、画素数)の画像処理画像データ(静止画像データや動画像データ)を一時的に記憶(保存)するデータ記憶部である。ライトバッファ2613Wも、例えば、SRAMなどのメモリで構成される。
 バスマスタ2613は、画像処理モジュール2602が画像処理を行って生成した画像処理画像データ(静止画像データや動画像データ)を、ライトバッファ2613Wに一時的に記憶(保存)し、予め定めたデータ量の画像処理画像データを記憶(保存)した後に、DMA転送のタイミングに合わせて、記憶(保存)している画像処理画像データをバスアービタ231に出力して、DRAM30に記憶させる(書き込む)。
 リードライト切り替え制御部2614は、バスマスタ2611が行うリードDMA転送の状態と、バスマスタ2613が行うライトDMA転送の状態とを観測する。そして、リードライト切り替え制御部2614は、図1に示した第1の実施形態のメモリアクセス装置を構成するリードライト切り替え制御部2603と同様に、観測したバスマスタ2611とバスマスタ2613とのそれぞれのDMA転送の状態に基づいて、バスアービタ231によってアクセス要求の受け付け(許可)をされたい、画像処理部261におけるDRAM30へのアクセス方向(書き込みまたは読み出し)を通知する。
 より具体的には、リードライト切り替え制御部2614は、バスマスタ2611が前処理画像データをDRAM30から取得する(読み出す)リードアクセスの要求と、リードアクセスの要求の受け付け(許可)と、リードバッファ2611Rに記憶(保存)されている前処理画像データのデータ量とのそれぞれを観測することによって、バスマスタ2611によるリードDMA転送の状態を観測する。図6に示した画像処理部261では、リードアクセス観測信号RAによってバスマスタ2611によるリードアクセスの要求および受け付け(許可)を観測し、リードバッファ観測信号RBによってリードバッファ2611Rに記憶されている前処理画像データのデータ量を観測している。なお、リードアクセス観測信号RAは、例えば、バスマスタ2611がリードアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ231がリードアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、リードバッファ観測信号RBは、リードバッファ2611Rの全ての記憶容量に前処理画像データが記憶(保存)されているか否かを表す信号や、リードバッファ2611Rにおける予め定めた割合よりも多くの記憶容量に前処理画像データが記憶(保存)されているか否かを表す信号である。
 また、リードライト切り替え制御部2614は、バスマスタ2613が画像処理画像データ(静止画像データや動画像データ)をDRAM30に記憶させる(書き込む)ライトアクセスの要求と、ライトアクセスの要求の受け付け(許可)と、ライトバッファ2613Wに記憶(保存)されている画像処理画像データのデータ量とのそれぞれを観測することによって、バスマスタ2613によるライトDMA転送の状態を観測する。図6に示した画像処理部261では、ライトアクセス観測信号WAによってバスマスタ2613によるライトアクセスの要求および受け付け(許可)を観測し、ライトバッファ観測信号WBによってライトバッファ2613Wに記憶されている画像処理画像データのデータ量を観測している。なお、ライトアクセス観測信号WAは、例えば、バスマスタ2613がライトアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ231がライトアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、ライトバッファ観測信号WBは、ライトバッファ2613Wの全ての記憶容量に画像処理画像データが記憶(保存)されているか否かを表す信号や、ライトバッファ2613Wにおける予め定めた割合よりも多くの記憶容量に画像処理画像データが記憶(保存)されているか否かを表す信号である。
 リードライト切り替え制御部2614は、図1に示した第1の実施形態のメモリアクセス装置を構成するリードライト切り替え制御部2603と同様に、観測したそれぞれのDMA転送の状態に基づいて、バスマスタ2611によるリードDMA転送と、バスマスタ2613によるライトDMA転送とのいずれのDMA転送を優先して行うかを判定する。そして、リードライト切り替え制御部2614は、図1に示した第1の実施形態のメモリアクセス装置を構成するリードライト切り替え制御部2603と同様に、判定した結果に基づいて、優先して行いたいDMA転送、つまり、バスアービタ231によってアクセス要求の受け付け(許可)をされたいDMA転送を通知するためのリードライト切り替え信号RWを生成する。
 なお、リードライト切り替え制御部2614が優先するDMA転送を判定するために用いるパラメータは、CPU220によって、リードライト切り替え制御部2614のレジスタに設定される。
 リードライト切り替え制御部2614は、生成したリードライト切り替え信号RWをバスアービタ231に出力することによって、優先して行いたいDMA転送(リードDMA転送またはライトDMA転送)を通知する。これにより、バスアービタ231は、画像処理部261からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWに基づいて、バスマスタ2611がDRAM30から前処理画像データを取得する(読み出す)リードDMA転送、またはバスマスタ2613がDRAM30に画像処理画像データを記憶させる(書き込む)ライトDMA転送のいずれか一方のDMA転送のアクセス要求を受け付ける(許可する)。
 また、リードライト切り替え制御部2614は、画像処理モジュール2602が行う画像処理の状態に応じて、バスマスタ2611とバスマスタ2613とのそれぞれのDMA転送の緊急度を通知する。このとき、リードライト切り替え制御部2614は、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)に基づいて、バスマスタ2611が行うリードDMA転送と、バスマスタ2613が行うライトDMA転送とのそれぞれのDMA転送における緊急度を判定するための緊急度閾値を算出する。そして、リードライト切り替え制御部2614は、観測したバスマスタ2611とバスマスタ2613とのそれぞれのDMA転送の状態を、算出した緊急度閾値と比較することによって、リードDMA転送とライトDMA転送とにおける緊急度を判定する。そして、リードライト切り替え制御部2614は、判定した結果に基づいて、リードDMA転送とライトDMA転送とのそれぞれのDMA転送の緊急度を通知するための緊急度信号URを生成する。
 なお、リードライト切り替え制御部2614には、画像処理モジュール2602が行う画像処理に対応するリードDMA転送とライトDMA転送とのそれぞれのDMA転送の緊急度を判定するための緊急度閾値を算出するために用いるパラメータが、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。なお、緊急度閾値を算出するために用いるパラメータは、CPU220がリードライト切り替え制御部2614のレジスタに設定する構成に限定されるものではない。例えば、画像処理モジュール2602が、実行している画像処理に関するパラメータを、緊急度閾値を算出するために用いるパラメータとして、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。また、例えば、画像処理部261の内部または外部に、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素を備え、この構成要素が、監視した画像処理の状態に基づいて、緊急度閾値を算出するために用いるパラメータを、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 リードライト切り替え制御部2614は、生成した緊急度信号URをバスアービタ231に出力することによって、それぞれのDMA転送(リードDMA転送またはライトDMA転送)の緊急度を通知する。これにより、バスアービタ231は、データバス210に接続されている画像処理装置21内のそれぞれの処理ブロックからのアクセス要求を調停する際に、緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。
 このような構成によって、撮像装置2は、イメージセンサ10によって被写体の静止画像や動画像を撮影し、撮影した静止画像や動画像に応じた表示画像を表示装置40に表示させる。また、撮像装置2は、イメージセンサ10によって撮影した静止画像や動画像に応じた記録画像を、不図示の記録媒体に記録させることもできる。
 また、撮像装置2では、画像処理装置21内の画像処理部261に備えたバスマスタ2611、バスマスタ2613、およびリードライト切り替え制御部2614と、バスアービタ231とで、第2の実施形態のメモリアクセス装置を構成する。言い換えれば、画像処理装置21においても、第1の実施形態における画像処理装置20と同様に、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う処理ブロックである画像処理部261に、第2の実施形態のメモリアクセス装置が構成される。
 そして、第2の実施形態のメモリアクセス装置では、バスマスタ2611およびバスマスタ2613のそれぞれがDRAM30との間で画像データの受け渡しを行う際に、リードライト切り替え制御部2614が、バスマスタ2611が行うリードDMA転送の状態と、バスマスタ2613が行うライトDMA転送の状態とを観測する。そして、第1の実施形態のメモリアクセス装置では、第1の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、観測したバスマスタ2611とバスマスタ2613とのそれぞれのDMA転送の状態に基づいて、優先して行いたい方のDMA転送(リードDMA転送またはライトDMA転送)を通知するためのリードライト切り替え信号RWを、バスアービタ231に出力する。これにより、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、バスアービタ231が、バスマスタ2611およびバスマスタ2613からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)。これにより、第2の実施形態のメモリアクセス装置では、第1の実施形態のメモリアクセス装置と同様に、バスマスタ2611によるDRAM30からの前処理画像データの読み出しと、バスマスタ2613による画像処理画像データ(静止画像データや動画像データ)のDRAM30への書き込みとの切り替えを適切に行うことができる。このことにより、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)では、第1の実施形態のメモリアクセス装置を搭載したシステム(撮像装置1や画像処理装置20)と同様に、DRAM30の状態を、データを読み出している状態およびデータを書き込む状態の一方の状態から他方の状態に切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。
 また、第2の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614が、画像処理モジュール2602が行う画像処理に関するパラメータと、観測したバスマスタ2611およびバスマスタ2613におけるそれぞれのDMA転送の状態から、それぞれのDMA転送の緊急度を判定し、判定した緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。これにより、第2の実施形態のメモリアクセス装置では、バスアービタ231が、それぞれの処理ブロックからのアクセス要求を調停する際に、緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。これにより、第2の実施形態のメモリアクセス装置では、画像処理部261が実行する画像処理の緊急度が高くなった場合に、バスアービタ231が、リードライト切り替え信号RWに基づいて、バスマスタ2611またはバスマスタ2613からのアクセス要求を優先して受け付ける(許可する)ことができる。
 これらのことにより、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)では、システムに破綻をきたす要因となり得るデータバス210における画像データの転送効率の低下を抑えつつ、第2の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602が、一連の画像処理を円滑に行うことができる。
 次に、第2の実施形態のメモリアクセス装置において、優先して行いたいDMA転送と、それぞれのDMA転送の緊急度とを通知する処理について説明する。図7は、本発明の第2の実施形態のメモリアクセス装置における通知の処理の処理手順を示したフローチャートである。
 上述したように、リードライト切り替え制御部2614は、バスマスタ2611が行うリードDMA転送におけるリードアクセスの要求およびリードバッファ2611Rに記憶(保存)されている前処理画像データのデータ量と、バスマスタ2613が行うライトDMA転送におけるライトアクセスの要求およびライトバッファ2613Wに記憶(保存)されている画像処理画像データのデータ量とのそれぞれを、DMA転送の状態として観測する。また、リードライト切り替え制御部2614には、画像処理モジュール2602が行う画像処理に対応するリードDMA転送とライトDMA転送とのそれぞれのDMA転送の緊急度を判定するための緊急度閾値を算出するために用いるパラメータが、レジスタに設定されている。
 リードライト切り替え制御部2614は、まず、観測したDMA転送の状態に基づいて、DMA転送の切り替え判定の処理を行う(ステップS100)。つまり、リードライト切り替え制御部2614は、リードDMA転送とライトDMA転送とのいずれのDMA転送を優先して行うかを判定する処理を行う。
 続いて、リードライト切り替え制御部2614は、観測したDMA転送の状態と、レジスタに設定されたパラメータとに基づいて、DMA転送の緊急度判定の処理を行う(ステップS200)。つまり、リードライト切り替え制御部2614は、リードDMA転送とライトDMA転送とのそれぞれのDMA転送の緊急度を判定する処理を行う。
 ここで、リードライト切り替え制御部2614が行うそれぞれの処理について説明する。なお、リードライト切り替え制御部2614がステップS100において行うDMA転送の切り替え判定の処理は、図2に示した第1の実施形態のメモリアクセス装置におけるDMA転送の切り替えを判定する処理と同様である。従って、リードライト切り替え制御部2614におけるDMA転送の切り替え判定の処理に関する詳細な説明は省略する。
 続いて、リードライト切り替え制御部2614がステップS200において行う緊急度判定の処理について説明する。図8は、本発明の第2の実施形態のメモリアクセス装置においてDMA転送の緊急度を判定する処理の処理手順を示したフローチャートである。
 DMA転送の緊急度を判定する処理においてリードライト切り替え制御部2614は、まず、レジスタに設定された、画像処理モジュール2602が行う画像処理に関するパラメータを用いて、リードDMA転送とライトDMA転送とのそれぞれのDMA転送に対応する緊急度閾値を算出する。また、リードライト切り替え制御部2614は、観測したDMA転送の状態に基づいて、リードDMA転送とライトDMA転送とのそれぞれのDMA転送における待ち時間を算出する(ステップS210)。
 なお、リードライト切り替え制御部2614がステップS210において算出する緊急度閾値の算出方法に関しては、後述する。
 なお、リードDMA転送とライトDMA転送とのそれぞれのDMA転送における待ち時間は、リードDMA転送のアクセス要求と、ライトDMA転送のアクセス要求とのそれぞれが、バスアービタ231によって受け付けられる(許可される)のを待っている時間である。より具体的には、リードDMA転送の待ち時間は、バスマスタ2611がリードDMA転送のアクセス要求をバスアービタ231に出力したときからの経過時間である。つまり、リードDMA転送の待ち時間は、バスマスタ2611がアクセス要求を出力した時間と現在の時間との差分の時間である。また、ライトDMA転送の待ち時間は、バスマスタ2613がライトDMA転送のアクセス要求をバスアービタ231に出力したときからの経過時間である。つまり、ライトDMA転送の待ち時間は、バスマスタ2613がアクセス要求を出力した時間と現在の時間との差分の時間である。なお、バスアービタ231に出力したアクセス要求がバスアービタ231によって受け付けられた(許可された)場合には、リードライト切り替え制御部2614は、リードDMA転送とライトDMA転送とのそれぞれのDMA転送における待ち時間として、DMA転送の切り替え判定の処理(ステップS100)を行った際にステップS120において算出した差分の時間を用いてもよい。
 続いて、リードライト切り替え制御部2614は、算出した待ち時間と緊急度閾値とを比較して、算出した待ち時間が、緊急度閾値よりも長いか否か判定する(ステップS220)。
 ステップS220において、算出した待ち時間が緊急度閾値よりも長くないと判定した場合(ステップS220の“NO”)、リードライト切り替え制御部2614は、判定した待ち時間に対応するDMA転送の状態は、緊急度が高くない(低い)と判定し、ステップS230に進む。そして、リードライト切り替え制御部2614は、判定した待ち時間に対応するDMA転送の緊急度は低いことを表す緊急度信号URを生成する(ステップS230)。
 一方、ステップS220において、算出した待ち時間が緊急度閾値よりも長いと判定した場合(ステップS220の“YES”)、リードライト切り替え制御部2614は、判定した待ち時間に対応するDMA転送の状態は、緊急度が高いと判定し、ステップS240に進む。そして、リードライト切り替え制御部2614は、判定した待ち時間に対応するDMA転送の緊急度が高いことを表す緊急度信号URを生成する(ステップS240)。
 リードライト切り替え制御部2614は、ステップS230またはステップS240で生成した緊急度信号URを、バスアービタ231に出力する。なお、リードライト切り替え制御部2614は、ステップS200における緊急度判定の処理を、バスマスタ2611とバスマスタ2613とのそれぞれに対して行う。より具体的には、リードライト切り替え制御部2614は、ステップS220における判定を、バスマスタ2611によるリードDMA転送の待ち時間と、バスマスタ2613によるライトDMA転送の待ち時間とのそれぞれに対して行う。これにより、リードライト切り替え制御部2614は、バスマスタ2611によるリードDMA転送と、バスマスタ2613によるライトDMA転送とを別々に、緊急度を判定することができる。このことにより、バスアービタ231には、それぞれのDMA転送(リードDMA転送およびライトDMA転送)の緊急度が通知される。
 次に、リードライト切り替え制御部2614がステップS210の処理において算出する緊急度閾値の算出方法について説明する。上述したように、緊急度閾値は、リードライト切り替え制御部2614のレジスタに設定された、画像処理モジュール2602が行う画像処理に関するパラメータを用いて算出する。なお、リードライト切り替え制御部2614における緊急度閾値の算出方法には、画像処理モジュール2602が行う画像処理に対応した様々な算出方法がある。
 まず、緊急度閾値の第1の算出方法について説明する。第1の算出方法は、画像処理モジュール2602が行う画像処理に待ちの状態が発生しないように規定した、DMA転送が終了するまでの限界(リミット)の時間に基づいて、DMA転送の緊急度を判定するための緊急度閾値を算出する方法である。つまり、第1の算出方法では、画像処理モジュール2602が規定された限界(リミット)の時間までに画像処理を完了することを基本として考えている。第1の算出方法では、リードライト切り替え制御部2614が、下式(5)によって緊急度閾値を算出する。
 緊急度閾値=リミット時間×ロス時間係数   ・・・(5)
 上式(5)において、リミット時間は、DMA転送が終了するまでの限界の時間である。リミット時間は、例えば、画像処理モジュール2602が行う画像処理に待ちの状態が発生しないようにするために必要な、DMA転送が終了するまでの時間を規定する。また、上式(5)において、ロス時間係数は、リミット時間に余裕(マージン)を持たせるための係数である。より具体的には、ロス時間係数は、例えば、DRAM30において、データを読み出している状態およびデータを書き込む状態の一方の状態から他方の状態に切り替えるときなどに必要な所定の時間(一定時間)のロス時間が発生した場合でも、ロス時間の影響を回避して、リミット時間までにDMA転送が終了するようにマージンを持たせるための係数である。ロス時間係数は、リミット時間に対する割合(パーセント)などで規定する。
 なお、リードライト切り替え制御部2614が第1の算出方法で緊急度閾値を算出するためのリミット時間とロス時間係数とは、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。
 続いて、緊急度閾値の第2の算出方法について説明する。第2の算出方法は、画像処理モジュール2602が1フレーム分の画像データの画像処理を行う際の処理時間に基づいて、DMA転送の緊急度を判定するための緊急度閾値を算出する方法である。第2の算出方法では、画像処理モジュール2602が、要求された処理時間までに1フレーム分の画像データの画像処理を完了する、つまり、1フレーム分の画像データの画像処理に遅れが発生しないようにするために必要な、1フレーム分の画像データのDMA転送の時間を確保することを基本として考えている。第2の算出方法では、リードライト切り替え制御部2614が、下式(6)~下式(11)によって緊急度閾値を算出する。
 最速処理時間=処理速度×出力総画素数   ・・・(6)
 処理余裕時間=要求処理時間-最速処理時間   ・・・(7)
 許容時間=最速処理時間+処理余裕時間×ロス時間係数
                           ・・・(8)
 残りの必要処理時間=残りの出力画素数×処理速度   ・・・(9)
 残りの許容時間=許容時間-現在の経過時間   ・・・(10)
 緊急度閾値=残りの許容時間-残りの必要処理時間
                          ・・・(11)
 上式(6)において、最速処理時間は、画像処理モジュール2602が1フレーム分の画像処理を最速で行う際の処理時間である。また、上式(6)において、処理速度は、画像処理モジュール2602が1画素の前処理画像データに対して画像処理を行う処理の速度である。言い換えれば、処理速度は、画像処理モジュール2602が1画素の前処理画像データの画像処理に要する処理時間である。また、上式(6)において、出力総画素数は、画像処理モジュール2602が画像処理を行って出力する1フレーム分の画像処理画像データ(静止画像データや動画像データ)の画素数である。
 上式(7)において、処理余裕時間は、画像処理モジュール2602が1フレーム分の画像処理を終了するまで間に存在する余裕(マージン)の時間である。言い換えれば、処理余裕時間は、この時間を超えても画像処理モジュール2602が1フレーム分の画像処理が終わらなかった場合には、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)に破綻をきたしてしまう時間である。また、上式(7)において、要求処理時間は、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)において、画像処理モジュール2602が1フレーム分の画像処理を終了するのに要求される処理時間である。なお、要求処理時間は、画像処理モジュール2602が画像処理を行うにあたって、CPU220が実行しているプログラムによる制御や処理が介在する時間を除いた時間である。つまり、要求処理時間は、画像処理モジュール2602における画像処理のみに対して要求される時間である。また、上式(7)において、最速処理時間は、上式(6)において算出した最速処理時間である。
 上式(8)において、許容時間は、画像処理モジュール2602が1フレーム分の画像処理を終了するまでの間に許容される遅れの時間である。また、上式(8)において、最速処理時間は、上式(6)において算出した最速処理時間である。また、上式(8)において、処理余裕時間は、上式(7)において算出した処理余裕時間である。また、上式(8)において、ロス時間係数は、処理余裕時間にさらに余裕(マージン)を持たせるための係数である。このロス時間係数は、第1の算出方法の上式(5)におけるロス時間係数と同様の考え方に基づいて、処理余裕時間に対する割合(パーセント)などで規定する。つまり、ロス時間係数は、例えば、DRAM30において、データを読み出している状態およびデータを書き込む状態の一方の状態から他方の状態に切り替えるときなどに必要な所定の時間(一定時間)のロス時間が発生した場合でも、ロス時間の影響を回避して、処理余裕時間内にDMA転送が終了するようにマージンを持たせるための割合(パーセント)などで規定する。
 上式(9)において、残りの必要処理時間は、画像処理モジュール2602が1フレーム分の画像処理を終了するまでに要する処理時間である。また、上式(9)において、残りの出力画素数は、画像処理モジュール2602が画像処理を行って1フレーム分の画像処理画像データ(静止画像データや動画像データ)を出力するまでに出力する必要がある画素数である。つまり、残りの出力画素数は、画像処理モジュール2602が現時点で画像処理が終わって出力していない画像処理画像データの画素数である。また、上式(9)において、処理速度は、上式(6)における処理速度と同じものである。
 上式(10)において、残りの許容時間は、画像処理モジュール2602が1フレーム分の画像処理を終了するまでの間に現時点で許容される遅れの時間である。また、上式(10)において、許容時間は、上式(8)において算出した許容時間である。また、上式(10)において、現在の経過時間は、画像処理モジュール2602が画像処理を開始したときから現時点までの経過時間である。
 上式(11)において、残りの許容時間は、上式(10)において算出した残りの許容時間である。また、上式(11)において、残りの必要処理時間は、上式(9)において算出した残りの必要処理時間である。
 リードライト切り替え制御部2614は、上式(6)~上式(11)によって、緊急度閾値を算出する。なお、第2の算出方法で緊急度閾値を算出するために上式(6)~上式(11)において算出するそれぞれの時間(値)の関係は、図9に示したような関係になっている。図9には、本発明の第2の実施形態のメモリアクセス装置においてDMA転送の緊急度を判定するための緊急度閾値を算出する際のそれぞれの段階における時間の関係の一例を示している。
 なお、リードライト切り替え制御部2614が第2の算出方法で緊急度閾値を算出するために上式(6)~上式(11)において用いる処理速度、出力総画素数、要求処理時間、ロス時間係数、残りの出力画素数、および現在の経過時間のそれぞれは、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。
 なお、リードライト切り替え制御部2614が第2の算出方法で緊急度閾値を算出するために上式(9)において用いる残りの出力画素数や、上式(10)において用いる現在の経過時間は、例えば、画像処理モジュール2602が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。また、例えば、画像処理部261の内部または外部に、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素を備えている場合には、この構成要素が、監視した画像処理の状態に基づいて、上式(9)において用いる残りの出力画素数や、上式(10)において用いる現在の経過時間を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 続いて、緊急度閾値の第3の算出方法について説明する。第3の算出方法は、画像処理モジュール2602が1フレームの領域を、同じ画素数の前処理画像データが含まれる複数の矩形のブロックに分割し、分割したそれぞれのブロックごとに画像処理を行う場合において、それぞれのブロックに対する画像処理の処理時間に基づいて、DMA転送の緊急度を判定するための緊急度閾値を算出する方法である。第3の算出方法では、第2の算出方法と同様の考えを基本とし、画像処理モジュール2602が分割したブロックごとに行う画像処理に対応するための変更を加えている。第3の算出方法では、リードライト切り替え制御部2614が、第2の算出方法における上式(6)~上式(11)の内、上式(9)で算出する残りの必要処理時間を、下式(12)で算出することによって、緊急度閾値を算出する。
 残りの必要処理時間=残りのブロック数×1ブロックの画素数×処理速度
                           ・・・(12)
 上式(12)において、残りの必要処理時間は、画像処理モジュール2602が分割した全てのブロックの画像処理を終了するまでに要する処理時間である。つまり、リードライト切り替え制御部2614が上式(12)において算出する残りの必要処理時間も、第2の算出方法の上式(9)において算出する残りの必要処理時間と同様に、画像処理モジュール2602が1フレーム分の画像処理を終了するまでに要する処理時間である。また、上式(12)において、残りのブロック数は、画像処理モジュール2602が1フレーム分の画像処理画像データ(静止画像データや動画像データ)を出力するまでに画像処理を行う必要があるブロック数である。つまり、残りのブロック数は、画像処理モジュール2602が分割したブロックにおいて、現時点で画像処理が終わっていないブロックの数である。また、上式(12)において、1ブロックの画素数は、画像処理モジュール2602が分割したそれぞれのブロックに含まれる画素数である。また、上式(12)において、処理速度は、第2の算出方法の上式(6)および上式(9)における処理速度と同じものである。
 リードライト切り替え制御部2614は、上式(6)~上式(8)、上式(12)、および上式(10)~上式(11)によって、緊急度閾値を算出する。なお、第3の算出方法で緊急度閾値を算出するために上式(6)~上式(8)、上式(12)、および上式(10)~上式(11)において算出するそれぞれの時間(値)の関係は、第2の算出方法において図9に示したような関係と同様である。
 なお、リードライト切り替え制御部2614が第3の算出方法で緊急度閾値を算出するために上式(12)において用いる残りのブロック数、1ブロックの画素数、および処理速度のそれぞれは、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。また、リードライト切り替え制御部2614が第3の算出方法で緊急度閾値を算出するために上式(6)~上式(8)、および上式(10)~上式(11)において用いる処理速度、出力総画素数、要求処理時間、ロス時間係数、および現在の経過時間のそれぞれも、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。
 なお、リードライト切り替え制御部2614が第3の算出方法で緊急度閾値を算出するために上式(12)において用いる残りのブロック数は、例えば、画像処理モジュール2602が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。さらに、リードライト切り替え制御部2614が第3の算出方法で緊急度閾値を算出するために上式(10)において用いる現在の経過時間も、例えば、画像処理モジュール2602が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。また、例えば、画像処理部261の内部または外部に、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素を備えている場合には、この構成要素が、監視した画像処理の状態に基づいて、上式(12)において用いる残りのブロック数や、上式(10)において用いる現在の経過時間を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 続いて、緊急度閾値の第4の算出方法について説明する。第4の算出方法は、画像処理モジュール2602が1フレームの領域を複数のブロックに分割して画像処理を行う際に、それぞれのブロックに含まれる画素数が異なる場合においても、それぞれのブロックに対する画像処理の処理時間に基づいて、DMA転送の緊急度を判定するための緊急度閾値を算出する方法である。なお、画像処理モジュール2602が画像処理を行うために分割したそれぞれのブロックに含まれる画素数が異なるような画像処理としては、例えば、歪補正処理などがある。つまり、分割したそれぞれのブロックごとに、処理に要する時間が異なる画像処理である。
 第4の算出方法でも、第3の算出方法と同様に、第2の算出方法と同様の考えを基本とし、画像処理モジュール2602が、含まれる画素数が異なるそれぞれのブロックに対応して画像処理を行うための変更を加えている。第4の算出方法では、リードライト切り替え制御部2614が、第2の算出方法における上式(6)~上式(11)の内、上式(9)で算出する残りの必要処理時間を、下式(13)で算出することによって、緊急度閾値を算出する。このとき、第4の算出方法では、下式(14)によって、残りの必要処理時間を下式(13)で算出するための変数を算出している。
 残りの必要処理時間=残りの入力画素数×処理速度
                          ・・・(13)
 残りの入力画素数=入力総画素数-現在の入力画素数
                          ・・・(14)
 上式(13)において、残りの必要処理時間は、画像処理モジュール2602が分割した全てのブロックの画像処理を終了するまでに要する処理時間である。つまり、リードライト切り替え制御部2614が上式(13)において算出する残りの必要処理時間も、第2の算出方法の上式(9)や、第3の算出方法の上式(12)において算出する残りの必要処理時間と同様に、画像処理モジュール2602が1フレーム分の画像処理を終了するまでに要する処理時間である。また、上式(13)において、残りの入力画素数は、上式(14)において算出する、画像処理モジュール2602が1フレーム分の画像処理画像データ(静止画像データや動画像データ)を出力するまでに画像処理を行う必要がある全てのブロックに含まれる画素数である。つまり、残りの入力画素数は、画像処理モジュール2602が分割したそれぞれのブロックにおいて、現時点で画像処理が終わっていないそれぞれのブロックに含まれる画素数である。言い換えれば、残りの入力画素数は、現時点で画像処理が終わっていないそれぞれのブロックに含まれる異なる画素数を合計したものである。また、上式(13)において、処理速度は、第2の算出方法の上式(6)および上式(9)、第3の算出方法の上式(12)における処理速度と同じものである。
 上式(14)において、入力総画素数は、画像処理モジュール2602が1フレーム分の画像処理画像データ(静止画像データや動画像データ)を出力するまでに、画像処理モジュール2602に入力される全ての画素数である。ここで、画像処理モジュール2602は、分割したそれぞれのブロックに対する画像処理(例えば、歪補正処理)を行うために、同じ画素の前処理画像データを異なるブロックの画像処理に用いることもある。この場合、入力総画素数は、1フレーム分の画素数よりも多くなる。従って、入力総画素数は、画像処理モジュール2602が画像処理を行うために用いる、全てのブロックに含まれる異なる画素数を合計したものである。また、上式(14)において、現在の入力画素数は、現在までに画像処理モジュール2602に入力された全ての画素数である。つまり、現在の入力画素数は、画像処理モジュール2602が分割したそれぞれのブロックにおいて、現時点で画像処理が終わったそれぞれのブロックに含まれる画素数である。言い換えれば、現在の入力画素数は、現在までに画像処理が終わったそれぞれのブロックに含まれる異なる画素数を合計したものである。
 リードライト切り替え制御部2614は、上式(6)~上式(8)、上式(14)、上式(13)、および上式(10)~上式(11)によって、緊急度閾値を算出する。なお、第4の算出方法で緊急度閾値を算出するために上式(6)~上式(8)、上式(14)、上式(13)、および上式(10)~上式(11)において算出するそれぞれの時間(値)の関係は、第2の算出方法において図9に示したような関係と同様に考えることができる。
 なお、リードライト切り替え制御部2614が第4の算出方法で緊急度閾値を算出するために上式(13)において用いる処理速度、上式(14)において用いる入力総画素数および現在の入力画素数のそれぞれは、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。また、リードライト切り替え制御部2614が第4の算出方法で緊急度閾値を算出するために上式(6)~上式(8)、および上式(10)~上式(11)において用いる処理速度、出力総画素数、要求処理時間、ロス時間係数、および現在の経過時間のそれぞれも、緊急度閾値を算出するために用いるパラメータとして、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されている。
 なお、リードライト切り替え制御部2614が第4の算出方法で緊急度閾値を算出するために上式(14)において用いる入力総画素数および現在の入力画素数は、例えば、画像処理モジュール2602が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。このとき、例えば、画像処理モジュール2602は、上式(14)において用いる入力総画素数および現在の入力画素数の代わりに、上式(13)において用いる残りの入力画素数を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。さらに、リードライト切り替え制御部2614が第4の算出方法で緊急度閾値を算出するために上式(10)において用いる現在の経過時間も、例えば、画像処理モジュール2602が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。また、例えば、画像処理部261の内部または外部に、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素を備えている場合には、この構成要素が、監視した画像処理の状態に基づいて、上式(14)において用いる入力総画素数および現在の入力画素数や、上式(10)において用いる現在の経過時間を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。このとき、例えば、画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素は、上式(14)において用いる入力総画素数および現在の入力画素数の代わりに、上式(13)において用いる残りの入力画素数を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 このように、リードライト切り替え制御部2614は、ステップS210の処理において、第1の算出方法~第4の算出方法に示したような算出方法によって、緊急度閾値を算出する。そして、リードライト切り替え制御部2614は、それぞれのDMA転送(リードDMA転送およびライトDMA転送)の緊急度を、算出した緊急度閾値を用いて判定し、それぞれのDMA転送の緊急度を表す緊急度信号URを、バスアービタ231に出力する。より具体的には、リードライト切り替え制御部2614は、算出したそれぞれのDMA転送の待ち時間が緊急度閾値よりも長くない場合には、DMA転送の緊急度は低いことを表す緊急度信号URをバスアービタ231に出力する。また、リードライト切り替え制御部2614は、算出したそれぞれのDMA転送の待ち時間が緊急度閾値よりも長い場合には、DMA転送の緊急度が高いことを表す緊急度信号URをバスアービタ231に出力する。
 これにより、バスアービタ231は、リードライト切り替え制御部2614から出力された緊急度信号URに応じて、それぞれの処理ブロックからのDRAM30へのアクセス要求を調停する。また、バスアービタ231は、画像処理部261を、DRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定する場合には、リードライト切り替え制御部2614から出力されたリードライト切り替え信号RWによって通知されたDMA転送のアクセス要求を受け付ける(許可する)。
 なお、バスアービタ231が、緊急度信号UR、つまり、DMA転送の優先度に基づいてDRAM30へのアクセス要求を調停する動作は、既存のバスアービタ(いわゆる、DMA調停回路)の技術に基づいて容易に考えることができる。従って、バスアービタ231が、緊急度信号URに応じて、バスマスタ2611によるリードDMA転送と、バスマスタ2613によるライトDMA転送とのいずれのDMA転送を優先する調停を行う動作に関する詳細な説明は省略する。
 また、バスアービタ231が、画像処理部261をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611から出力されたリードDMA転送のアクセス要求、またはバスマスタ2613から出力されたライトDMA転送のアクセス要求のいずれかを受け付ける(許可する)動作は、第1の実施形態のメモリアクセス装置を構成するバスアービタ230と同様である。このため、第2の実施形態のメモリアクセス装置においてDMA転送を行うタイミングは、図4および図5を用いて説明した第1の実施形態のメモリアクセス装置においてDMA転送を行うタイミングと同様である。従って、第2の実施形態のメモリアクセス装置においてDMA転送を行うタイミング、つまり、DMA転送を第1の切り替え閾値に基づいて切り替える動作と、DMA転送を第2の切り替え閾値に基づいて切り替える動作に関する詳細な説明は省略する。
 このような構成および動作によって、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2614が、バスマスタ2611によるリードDMA転送の状態と、バスマスタ2613によるライトDMA転送の状態とを観測する。そして、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、優先して行いたいDMA転送を通知するためのリードライト切り替え信号RWを、バスアービタ231に出力する。このとき、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、リードバッファ2611Rおよびライトバッファ2613Wの記憶容量にある程度の余裕をもった状態で、リードライト切り替え信号RWを変更する。そして、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、バスアービタ231が、バスマスタ2611からのリードDMA転送のアクセス要求、またはバスマスタ2613からのライトDMA転送のアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知されたDMA転送のアクセス要求を受け付ける(許可する)。これにより、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30におけるデータを読み出している状態からデータを書き込む状態への切り替えや、データを書き込んでいる状態からデータを読み出す状態への切り替えを適切に行うことができる。このことにより、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30の状態を切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。
 また、第2の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614が、画像処理モジュール2602が行う画像処理に関するパラメータと、観測したバスマスタ2611およびバスマスタ2613におけるそれぞれのDMA転送の状態から、それぞれのDMA転送の緊急度を判定して、緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。そして、第2の実施形態のメモリアクセス装置では、バスアービタ231が、それぞれの処理ブロックからのアクセス要求を調停する際に、緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。これにより、第2の実施形態のメモリアクセス装置では、画像処理部261が実行する画像処理の緊急度が高くなった場合に、バスアービタ231が、リードライト切り替え信号RWに基づいて、バスマスタ2611またはバスマスタ2613からのアクセス要求を優先して受け付ける(許可する)ことができる。このことにより、第2の実施形態のメモリアクセス装置では、画像処理モジュール2602による一連の画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 これらのことにより、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)では、システムに破綻をきたす要因となり得るデータバス210における画像データの転送効率の低下を抑えつつ、第2の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602が、一連の画像処理を円滑に行うことができる。
 第2の実施形態によれば、バスマスタは、少なくとも、リードバッファ(リードバッファ2611R)を備え、リードアクセス要求(リードアクセスのDMA転送:リードDMA転送)を出力するリードバスマスタ(バスマスタ2611)と、ライトバッファ(ライトバッファ2613W)を備え、ライトアクセス要求(ライトアクセスのDMA転送:ライトDMA転送)を出力するライトバスマスタ(バスマスタ2613)と、によって構成される、メモリアクセス装置(メモリアクセス装置)が構成される。
 また、第2の実施形態によれば、リードライト切り替え制御部(リードライト切り替え制御部2614)は、予め設定された処理モジュール(画像処理モジュール2602)が行う処理(画像処理)に関する設定を用いて、バスマスタ(バスマスタ2611またはバスマスタ2613)が出力したアクセス要求(バスマスタ2611が行うリードDMA転送と、バスマスタ2613が行うライトDMA転送)の緊急度を判定するための緊急度閾値を算出し、観測したそれぞれの状態に基づいて算出した、バスマスタ(バスマスタ2611およびバスマスタ2613)が出力したアクセス要求(リードDMA転送およびライトDMA転送)がバスアービタ(バスアービタ231)に受け付けられていないアクセス要求(DMA転送)の待ち時間が、緊急度閾値よりも長い場合に緊急度が高く、緊急度閾値よりも長くない場合に緊急度が低いことを通知するための緊急度信号(緊急度信号UR)を出力し、バスアービタ231は、メモリ(DRAM30)へのアクセス要求(DMA転送)を調停する際に、緊急度信号によって緊急度が高いことが通知されたバスマスタ(バスマスタ2611またはバスマスタ2613)から出力されたアクセス要求(DMA転送)の優先度を高くして調停する、メモリアクセス装置が構成される。
 また、第2の実施形態によれば、緊急度閾値は、画像処理モジュール2602が行う処理(画像処理)が待たされる状態が発生しないように規定した、バスマスタ(バスマスタ2611またはバスマスタ2613)によるDRAM30へのアクセス(DMA転送)が終了するまでの限界の時間(リミット時間)に、DRAM30の状態を切り替えるときに必要な時間(所定(一定)の時間のロス時間)に基づいて設定した限界の時間に対する割合(ロス時間係数)を乗算した時間の閾値である、メモリアクセス装置が構成される。
 また、第2の実施形態によれば、緊急度閾値は、画像処理モジュール2602における処理の速度(処理速度)および処理の量(出力総画素数)と、画像処理モジュール2602が行う処理(画像処理)を終了させるまでに要求される要求処理時間と、DRAM30の状態を切り替えるときに必要な時間(所定(一定)の時間のロス時間)に基づいて設定した要求処理時間に対する割合(ロス時間係数)と、画像処理モジュール2602における残りの処理の量(残りの出力画素数)と、画像処理モジュール2602が処理(画像処理)を開始してから現在までの処理時間(現在の経過時間)と、に基づいて算出される時間の閾値である、メモリアクセス装置が構成される。
 また、第2の実施形態によれば、緊急度閾値は、画像処理モジュール2602が処理(画像処理)を複数回に分けて行う(1フレームの領域を同じ画素数の前処理画像データが含まれる複数の矩形のブロックに分割し、分割したそれぞれのブロックごとに画像処理を行う)場合において、画像処理モジュール2602における処理の速度(処理速度)および処理の量(出力総画素数)と、画像処理モジュール2602が行う処理(画像処理)を終了させるまでに要求される要求処理時間と、DRAM30の状態を切り替えるときに必要な時間(所定(一定)の時間のロス時間)に基づいて設定した要求処理時間に対する割合(ロス時間係数)と、画像処理モジュール2602における残りの処理の回数(残りのブロック数)から求められる残りの処理の量(残りの必要処理時間)と、画像処理モジュール2602が処理(画像処理)を開始してから現在までの処理時間(現在の経過時間)と、に基づいて算出される時間の閾値である、メモリアクセス装置が構成される。
 また、第2の実施形態によれば、緊急度閾値は、画像処理モジュール2602が処理を処理の量が異なる複数回に分けて行う(1フレームの領域を複数のブロックに分割して画像処理を行う際に、それぞれのブロックに含まれる画素数が異なる)場合において、画像処理モジュール2602における処理の速度(処理速度)および処理の量(出力総画素数)と、画像処理モジュール2602が行う処理(画像処理)を終了させるまでに要求される要求処理時間と、DRAM30の状態を切り替えるときに必要な時間(所定(一定)の時間のロス時間)に基づいて設定した要求処理時間に対する割合(ロス時間係数)と、画像処理モジュール2602における全体の処理の量(入力総画素数)と現在まで終了した処理の量(現在の入力画素数)から求められる残りの処理の量(残りの入力画素数)と、画像処理モジュール2602が処理(画像処理)を開始してから現在までの処理時間(現在の経過時間)と、に基づいて算出される時間の閾値である、メモリアクセス装置が構成される。
 上述したように、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2614が、バスマスタ2611およびバスマスタ2613におけるDMA転送の状態を観測する。そして、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、優先して行いたい方のDMA転送を通知するためのリードライト切り替え信号RWを、早いタイミングでバスアービタ231に出力する。これにより、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30の状態の切り替えを適切に行って、バスアービタ231が、バスマスタ2611またはバスマスタ2613からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)ことができる。これにより、第2の実施形態のメモリアクセス装置でも、第1の実施形態のメモリアクセス装置と同様に、DRAM30の状態を切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなく、データバス210における画像データの転送効率の低下を少なくして(抑えて)、画像処理モジュール2602による画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 また、第2の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614が、画像処理モジュール2602が行う画像処理に関するパラメータと、観測したバスマスタ2611およびバスマスタ2613におけるそれぞれのDMA転送の状態から、それぞれのDMA転送の緊急度を判定する。そして、第2の実施形態のメモリアクセス装置では、判定したそれぞれのDMA転送の緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。これにより、第2の実施形態のメモリアクセス装置では、バスアービタ231が、画像処理部261に備えたそれぞれの処理ブロックからのアクセス要求を調停する際に、リードライト切り替え制御部2614から出力された緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行うことができる。このことにより、第2の実施形態のメモリアクセス装置では、画像処理部261が実行する画像処理の緊急度が高くなった場合に、バスアービタ231が、リードライト切り替え信号RWに基づいて、バスマスタ2611またはバスマスタ2613からのアクセス要求を優先して受け付け(許可し)、画像処理モジュール2602による一連の画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 これらのことにより、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)では、システムに破綻をきたす要因となり得るデータバス210における画像データの転送効率の低下を抑えつつ、第2の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602が、一連の画像処理を円滑に行うことができる。
 なお、第2の実施形態のメモリアクセス装置では、バスマスタ2611とバスマスタ2613との複数のバスマスタを備えた構成であるが、DRAM30との間で行うDMA転送は、読み出しのアクセス方向のDMA転送(リードDMA転送)と書き込みのアクセス方向のDMA転送(ライトDMA転送)とが1つずつである構成について説明した。しかし、本発明のメモリアクセス装置におけるDRAM30との間で行う双方向のDMA転送におけるそれぞれの数は、第2の実施形態のメモリアクセス装置に示した1つずつである構成に限定されるものではない。つまり、読み出しのアクセス方向の複数のDMA転送と、書き込みのアクセス方向の複数のDMA転送とを行うメモリアクセス装置を構成してもよい。言い換えれば、メモリアクセス装置に、DRAM30に対する読み出しのアクセス方向のDMA転送を行うバスマスタと、DRAM30に対する書き込みのアクセス方向のDMA転送を行うバスマスタとのそれぞれを複数備えた構成のメモリアクセス装置を構成してもよい。
(第3の実施形態)
 次に、本発明の第3の実施形態のメモリアクセス装置について説明する。本発明の第3の実施形態のメモリアクセス装置は、メモリアクセス装置を構成するバスマスタとして、書き込みのアクセス方向のDMA転送を行う複数のバスマスタと、読み出しのアクセス方向のDMA転送を行う複数のバスマスタを備えた構成である。なお、以下の説明においても、本発明の第3の実施形態のメモリアクセス装置が、例えば、静止画用カメラや動画用カメラなどの撮像装置に搭載されている画像処理装置に備えられている場合について説明する。
 図10は、本発明の第3の実施形態におけるメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の概略構成を示したブロック図である。なお、図10には、第3の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置において、第3の実施形態のメモリアクセス装置に直接関連する構成要素のみを示している。つまり、図10には、第3の実施形態のメモリアクセス装置を備えた画像処理装置の構成要素の一部のみを示している。
 図10に示した第3の実施形態のメモリアクセス装置を備えた画像処理装置の構成には、図6に示した第2の実施形態のメモリアクセス装置を備えた画像処理部261と同様の構成要素を含んでいる。従って、第3の実施形態のメモリアクセス装置を備えた画像処理装置の構成要素において、第2の実施形態のメモリアクセス装置を備えた画像処理部261の構成要素と同様の構成要素には、同一の符号を付与し、それぞれの構成要素に関する詳細な説明は省略する。なお、図10には示していないが、第3の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の構成には、図6に示した第2の実施形態のメモリアクセス装置を備えた画像処理部261を搭載した撮像装置2と同様の構成要素を含んでいる。従って、第3の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置の構成要素において、第2の実施形態のメモリアクセス装置を備えた画像処理部261を搭載した撮像装置2の構成要素と同様の構成要素を表すときには同一の符号を用いて説明する。なお、以下の説明においては、第3の実施形態のメモリアクセス装置を備えた画像処理装置を搭載した撮像装置を、「撮像装置3」という。
 図10に示した画像処理装置22は、CPU220と、バスアービタ231と、不図示のDRAMインターフェース部240と、不図示の前処理部250と、画像処理部262と、不図示の表示処理部270と、を備えている。また、画像処理部262は、3つのバスマスタ2611-1~バスマスタ2611-3と、4つの画像処理モジュール2602-1~画像処理モジュール2602-4と、2つのバスマスタ2613-1およびバスマスタ2613-2と、リードライト切り替え制御部2614と、を備えている。また、バスマスタ2611-1は、リードバッファ2611R-1を備えている。また、バスマスタ2611-2は、リードバッファ2611R-2を備えている。また、バスマスタ2611-3は、リードバッファ2611R-3を備えている。また、バスマスタ2613-1は、ライトバッファ2613W-1を備えている。また、バスマスタ2613-2は、ライトバッファ2613W-2を備えている。画像処理装置22では、バスアービタ231と、不図示の前処理部250と、画像処理部262と、不図示の表示処理部270とのそれぞれが、共通のデータバス210に接続されている。
 なお、図10に示した画像処理装置22では、画像処理部262に備えた3つのバスマスタ2611-1~バスマスタ2611-3、2つのバスマスタ2613-1およびバスマスタ2613-2、およびリードライト切り替え制御部2614と、バスアービタ231との構成が、第3の実施形態のメモリアクセス装置に相当する。
 なお、以下の説明においては、3つのバスマスタ2611-1~バスマスタ2611-3のそれぞれを区別しない場合には、単に「バスマスタ2611」という。また、2つのバスマスタ2613-1とバスマスタ2613-2とのそれぞれを区別しない場合には、単に「バスマスタ2613」という。また、4つの画像処理モジュール2602-1~画像処理モジュール2602-4のそれぞれを区別しない場合には、単に「画像処理モジュール2602」という。
 画像処理装置22は、図6に示した第2の実施形態における画像処理装置21と同様に、不図示のイメージセンサ10から出力された画素信号に対して予め定めた画像処理を行って、静止画像や動画像を生成する。また、画像処理装置22は、第2の実施形態における画像処理装置21と同様に、生成した静止画像や動画像に応じた表示画像を生成し、生成した表示画像を不図示の表示装置40に表示させる。また、画像処理装置22は、第2の実施形態における画像処理装置21と同様に、生成した静止画像や動画像に応じた記録画像を生成し、生成した記録画像を不図示の記録媒体に記録させることもできる。
 画像処理装置22では、第2の実施形態における画像処理装置21と同様に、不図示の前処理部250と、画像処理部262と、不図示の表示処理部270とのそれぞれが、画像処理装置22において実行する画像処理の処理機能を実現する処理ブロックである。画像処理装置22では、第2の実施形態における画像処理装置21と同様に、不図示の前処理部250、画像処理部262、および不図示の表示処理部270のそれぞれが、データバス210を介したDMA転送によってDRAM30にアクセスする。
 画像処理部262は、図6に示した第2の実施形態における画像処理装置21に備えた画像処理部262と同様に、DRAM30に記憶された前処理画像データに対して予め定めた画像処理を施す処理ブロックである。画像処理部262でも、画像処理を施す対象の前処理画像データを取得する(読み出す)ためのDMA転送(リードDMA転送)と、画像処理を施して生成した画像データをDRAM30に記憶する(書き込む)ためのDMA転送(ライトDMA転送)とを行う。上述したように、画像処理部262は、3つのバスマスタ2611-1~バスマスタ2611-3と、4つの画像処理モジュール2602-1~画像処理モジュール2602-4と、2つのバスマスタ2613-1およびバスマスタ2613-2と、リードライト切り替え制御部2614と、を備えている。
 バスマスタ2611-1~バスマスタ2611-3のそれぞれは、図6に示した第2の実施形態における画像処理装置21内の画像処理部262に備えたバスマスタ2611である。バスマスタ2611-1~バスマスタ2611-3のそれぞれは、対応する画像処理モジュール2602が画像処理を行う対象の画像データを、リードDMA転送によってDRAM30から取得して(読み出して)、対応する画像処理モジュール2602に出力する。なお、バスマスタ2611-1~バスマスタ2611-3のそれぞれがリードDMA転送によってDRAM30から取得する(読み出す)画像データは、前処理画像データに限定されるものではない。上述したように、バスマスタ2611-1は、リードバッファ2611R-1を備えている。また、バスマスタ2611-2は、リードバッファ2611R-2を備えている。また、バスマスタ2611-3は、リードバッファ2611R-3を備えている。
 バスマスタ2611-1~バスマスタ2611-3のそれぞれは、リードDMA転送によってDRAM30から取得した(読み出した)画像データを、対応するリードバッファ2611Rに一時的に記憶(保存)する。そして、バスマスタ2611-1~バスマスタ2611-3のそれぞれは、予め定めたデータ量の画像データを記憶(保存)した後に、対応する画像処理モジュール2602からの要求に応じて、つまり、対応する画像処理モジュール2602が画像処理を行うタイミングに合わせて、記憶(保存)している画像データを、対応する画像処理モジュール2602に出力する。
 リードバッファ2611R-1~リードバッファ2611R-3のそれぞれは、対応するバスマスタ2611がリードDMA転送によってDRAM30から取得した(読み出した)、予め定めたデータ量(例えば、画素数)の画像データを一時的に記憶(保存)する、図6に示した第2の実施形態のメモリアクセス装置を構成するバスマスタ2611に備えたリードバッファ2611Rである。
 バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、図6に示した第2の実施形態における画像処理装置21内の画像処理部262に備えたバスマスタ2613である。バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、対応する画像処理モジュール2602が画像処理を行った後の画像データを、ライトDMA転送によってDRAM30に記憶させる(書き込む)。なお、バスマスタ2613-1とバスマスタ2613-2とのそれぞれがライトDMA転送によってDRAM30に記憶させる(書き込む)画像データは、画像処理画像データ(静止画像データや動画像データ)に限定されるものではない。上述したように、バスマスタ2613-1は、ライトバッファ2613W-1を備えている。また、バスマスタ2613-2は、ライトバッファ2613W-2を備えている。
 バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、対応する画像処理モジュール2602が画像処理を行って生成した画像データを、対応するライトバッファ2613Wに一時的に記憶(保存)する。そして、バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、予め定めたデータ量の画像データを記憶(保存)した後に、DMA転送のタイミングに合わせて、記憶(保存)している画像データをバスアービタ231に出力して、DRAM30に記憶させる(書き込む)。
 ライトバッファ2613W-1とライトバッファ2613W-2とのそれぞれは、対応するバスマスタ2613がライトDMA転送によってDRAM30に記憶させる(書き込む)、予め定めたデータ量(例えば、画素数)の画像データを一時的に記憶(保存)する、図6に示した第2の実施形態のメモリアクセス装置を構成するバスマスタ2613に備えたライトバッファ2613Wである。
 リードライト切り替え制御部2614は、図6に示した第2の実施形態のメモリアクセス装置を構成するリードライト切り替え制御部2614である。ただし、第3の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614は、バスマスタ2611-1~バスマスタ2611-3のそれぞれが行うリードDMA転送の状態と、バスマスタ2613-1とバスマスタ2613-2とのそれぞれが行うライトDMA転送の状態とを観測する。そして、リードライト切り替え制御部2614は、観測したそれぞれのバスマスタ2611とそれぞれのバスマスタ2613とのDMA転送の状態に基づいて、バスアービタ231によってアクセス要求の受け付け(許可)をされたいDMA転送を、リードライト切り替え信号RWによって通知する。
 より具体的には、リードライト切り替え制御部2614は、バスマスタ2611のそれぞれが画像データをDRAM30から取得する(読み出す)リードアクセスの要求と、リードアクセスの要求の受け付け(許可)と、リードバッファ2611Rのそれぞれに記憶(保存)されている画像データのデータ量とのそれぞれを観測することによって、バスマスタ2611のそれぞれによるリードDMA転送の状態を観測する。図10に示した画像処理部262では、リードアクセス観測信号RA-1によってバスマスタ2611-1によるリードアクセスの要求および受け付け(許可)を観測し、リードバッファ観測信号RB-1によってリードバッファ2611R-1に記憶されている画像データのデータ量を観測している。また、図10に示した画像処理部262では、リードアクセス観測信号RA-2によってバスマスタ2611-2によるリードアクセスの要求および受け付け(許可)を観測し、リードバッファ観測信号RB-2によってリードバッファ2611R-2に記憶されている画像データのデータ量を観測している。また、図10に示した画像処理部262では、リードアクセス観測信号RA-3によってバスマスタ2611-3によるリードアクセスの要求および受け付け(許可)を観測し、リードバッファ観測信号RB-3によってリードバッファ2611R-3に記憶されている画像データのデータ量を観測している。なお、リードアクセス観測信号RA-1~リードアクセス観測信号RA-3のそれぞれは、対応するバスマスタ2611がリードアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ231がそれぞれのリードアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、リードバッファ観測信号RB-1~リードバッファ観測信号RB-3のそれぞれは、対応するリードバッファ2611Rの全ての記憶容量に画像データが記憶(保存)されているか否かを表す信号や、対応するリードバッファ2611Rにおける予め定めた割合よりも多くの記憶容量に画像データが記憶(保存)されているか否かを表す信号である。
 また、リードライト切り替え制御部2614は、バスマスタ2613のそれぞれが画像データをDRAM30に記憶させる(書き込む)ライトアクセスの要求と、ライトアクセスの要求の受け付け(許可)と、ライトバッファ2613Wのそれぞれに記憶(保存)されている画像データのデータ量とのそれぞれを観測することによって、バスマスタ2613のそれぞれによるライトDMA転送の状態を観測する。図10に示した画像処理部262では、ライトアクセス観測信号WA-1によってバスマスタ2613-1によるライトアクセスの要求および受け付け(許可)を観測し、ライトバッファ観測信号WB-1によってライトバッファ2613W-1に記憶されている画像データのデータ量を観測している。また、図10に示した画像処理部262では、ライトアクセス観測信号WA-2によってバスマスタ2613-2によるライトアクセスの要求および受け付け(許可)を観測し、ライトバッファ観測信号WB-2によってライトバッファ2613W-2に記憶されている画像データのデータ量を観測している。なお、ライトアクセス観測信号WA-1~ライトアクセス観測信号WA-2のそれぞれは、対応するバスマスタ2613がライトアクセスを要求するためのアクセス要求信号(DMA要求信号)、およびバスアービタ231がそれぞれのライトアクセスの要求を受け付けるアクセス受け付け信号(DMA許可信号)である。また、ライトバッファ観測信号WB-1~ライトバッファ観測信号WB-2のそれぞれは、対応するライトバッファ2613Wの全ての記憶容量に画像データが記憶(保存)されているか否かを表す信号や、対応するライトバッファ2613Wにおける予め定めた割合よりも多くの記憶容量に画像データが記憶(保存)されているか否かを表す信号である。
 リードライト切り替え制御部2614は、観測したそれぞれのDMA転送の状態に基づいて、それぞれのバスマスタ2611によるリードDMA転送と、それぞれのバスマスタ2613によるライトDMA転送とのいずれのDMA転送を優先して行うかを判定する。このとき、リードライト切り替え制御部2614でも、ステップS110における画像処理モジュール2602のそれぞれが実行する画像処理が待たされている状態か否かの判定において、図3に示したDMA転送の状態をまとめた表に基づいた判定を行う。このとき、第3の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614は、バスマスタ2611-1~バスマスタ2611-3を1つのバスマスタ2611として考え、バスマスタ2613-1とバスマスタ2613-2とを1つのバスマスタ2613として考えて判定を行う。
 より具体的には、第3の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614が、リードバッファ2611R-1~リードバッファ2611R-3のいずれかに、対応する画像処理モジュール2602が画像処理を行うのに十分なデータ量の画像データが記憶(保存)されていることを観測できない場合には、図3における「リードバッファ」の項目が「エンプティ」であるものとして判定する。一方、リードライト切り替え制御部2614が、リードバッファ2611R-1~リードバッファ2611R-3の全てに、対応する画像処理モジュール2602が画像処理を行うのに十分なデータ量の画像データが記憶(保存)されていることを観測した場合に、図3における「リードバッファ」の項目が「フル」であるものとして判定する。
 また、第3の実施形態のメモリアクセス装置では、リードライト切り替え制御部2614が、バスマスタ2613-1とバスマスタ2613-2とのいずれかに、ライトDMA転送によってDRAM30に記憶させる(書き込む)のに十分なデータ量の画像データが記憶(保存)されていることを観測した場合には、図3における「ライトバッファ」の項目が「フル」であるものとして判定する。一方、リードライト切り替え制御部2614が、バスマスタ2613-1とバスマスタ2613-2との全てに、ライトDMA転送によってDRAM30に記憶させる(書き込む)のに十分なデータ量の画像データが記憶(保存)されていることを観測できない場合には、図3における「ライトバッファ」の項目が「エンプティ」であるものとして判定する。
 これにより、リードライト切り替え制御部2614は、観測したDMA転送の状態が、リードDMA転送のアクセス要求を出力し、リードバッファ2611R-1~リードバッファ2611R-3のいずれか1つと、バスマスタ2613-1とバスマスタ2613-2との全てが「エンプティ」である場合には、バスマスタ2611が、リードDMA転送のアクセス要求の受け付け(許可)を待っている状態で、対応する画像処理モジュール2602が画像処理を停止していると判定する。
 一方、リードライト切り替え制御部2614は、観測したDMA転送の状態が、ライトDMA転送のアクセス要求を出力し、バスマスタ2613-1とバスマスタ2613-2とのいずれかと、リードバッファ2611R-1~リードバッファ2611R-3の全てが「フル」である場合には、バスマスタ2613が、ライトDMA転送のアクセス要求の受け付け(許可)を待っている状態で、対応する画像処理モジュール2602が画像処理を停止していると判定する。
 そして、リードライト切り替え制御部2614は、判定した結果に基づいて生成したリードライト切り替え信号RWをバスアービタ231に出力することによって、優先して行いたいDMA転送、つまり、バスアービタ231によってアクセス要求の受け付け(許可)をされたいDMA転送を通知する。これにより、バスアービタ231は、画像処理部262からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWに基づいて、それぞれのバスマスタ2611がDRAM30から画像データを取得する(読み出す)リードDMA転送と、それぞれのバスマスタ2613がDRAM30に画像データを記憶させる(書き込む)ライトDMA転送のいずれか一方のDMA転送のアクセス要求を受け付ける(許可する)。
 なお、第3の実施形態のメモリアクセス装置においてリードライト切り替え制御部2614がバスマスタ2611とバスマスタ2613とのそれぞれのDMA転送の緊急度を通知するための判定は、第2の実施形態のメモリアクセス装置においてリードライト切り替え制御部2614がそれぞれのDMA転送の緊急度を通知するための判定と同様である。つまり、リードライト切り替え制御部2614は、それぞれのバスマスタ2611によるリードDMA転送と、それぞれのバスマスタ2613によるライトDMA転送とを別々に、緊急度を判定する。そして、バスアービタ231には、判定した結果に基づいて生成した、それぞれのDMA転送の緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。これにより、バスアービタ231は、データバス210に接続されている画像処理装置22内のそれぞれの処理ブロックからのアクセス要求を調停する際に、緊急度信号URに応じて、画像処理部262からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。
 ここで、画像処理部262においてDMA転送を切り替え閾値に基づいて切り替える動作の一例について説明する。なお、以下の説明においては、説明を容易にするため、第1の実施形態のメモリアクセス装置において説明した、画像処理部260がDMA転送を切り替え閾値に基づいて切り替える動作と同様に、画像処理部262のみがDRAM30へのアクセス要求をバスアービタ231に出力してDMA転送を行うものとして説明する。
 まず、画像処理部262におけるDMA転送を第1の切り替え閾値に基づいて切り替える動作について説明する。より具体的には、リードライト切り替え制御部2614が、第1の切り替え閾値に基づいてリードライト切り替え信号RWを変更して(切り替えて)、バスマスタ2611-1~バスマスタ2611-3のそれぞれが行うリードDMA転送と、バスマスタ2613-1とバスマスタ2613-2とのそれぞれが行うライトDMA転送とを切り替える動作について説明する。図11は、本発明の第3の実施形態のメモリアクセス装置においてDMA転送を行うタイミングの一例を示したタイミングチャートである。
 図11には、図4に示した第1の実施形態のメモリアクセス装置において第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様に、バスマスタ2611に備えたリードバッファ2611Rと、バスマスタ2613に備えたライトバッファ2613Wとのそれぞれに記憶(保存)しているデータ量の変移で、DMA転送を切り替える動作のタイミングの一例を示している。より具体的には、バスマスタ2611-1に備えたリードバッファ2611R-1、バスマスタ2611-2に備えたリードバッファ2611R-2、バスマスタ2611-3に備えたリードバッファ2611R-3、バスマスタ2613-1に備えたライトバッファ2613W-1、およびバスマスタ2613-2に備えたライトバッファ2613W-2のそれぞれに記憶(保存)しているデータ量の変移で、DMA転送を切り替える動作のタイミングの一例を示している。なお、図11においても、図4に示した第1の実施形態のメモリアクセス装置において第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様に、リードバッファ2611Rとライトバッファ2613Wとのそれぞれの構成がダブルバッファの構成である場合のデータ量の変移を示している。
 また、図11には、図4に示した第1の実施形態のメモリアクセス装置において第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様に、リードライト切り替え制御部2614がバスアービタ231に出力するリードライト切り替え信号RWと、バスアービタ231によって受け付けられる(許可される)DMA転送とのそれぞれのタイミングの一例を示している。なお、図11においても、リードライト切り替え信号RWが表すレベル、およびDMA転送のタイミングは、図4に示した第1の実施形態のメモリアクセス装置において第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様である。
 また、図11には、リードライト切り替え制御部2614がバスアービタ231に出力する緊急度信号URのタイミングの一例を示している。なお、図11においては、リードライト切り替え制御部2614が出力する緊急度信号URが、“High”レベルで緊急度が高いことを表し、“Low”レベルで緊急度が低いことを表している。
 画像処理部262が画像データに対する画像処理を開始すると、バスマスタ2611-1と、バスマスタ2611-2と、バスマスタ2611-3とのそれぞれは、まず、リードDMA転送によって、画像処理の対象の画像データをDRAM30から取得する(読み出す)。このため、リードライト切り替え制御部2614は、リードDMA転送を優先することを通知する“High”レベルのリードライト切り替え信号RWを、バスアービタ231に出力する。また、リードライト切り替え制御部2614は、緊急度が低いことを表す“Low”レベルの緊急度信号URを、バスアービタ231に出力する。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611-1と、バスマスタ2611-2と、バスマスタ2611-3とのそれぞれから出力されたリードDMA転送のアクセス要求を順次受け付ける(許可する)。これにより、リードバッファ2611R-1と、リードバッファ2611R-2と、リードバッファ2611R-3とのそれぞれには、DRAM30から取得した(読み出した)画像データが、順次記憶(保存)される。
 そして、それぞれのリードバッファ2611Rに記憶(保存)された画像データのデータ量が、画像処理開始可能データ量以上になると、画像処理モジュール2602のそれぞれは、対応するリードバッファ2611Rに記憶(保存)された画像データを読み出して画像処理を行うことができるようになる。このとき、バスマスタ2611のそれぞれは、対応するリードバッファ2611Rに記憶(保存)された画像データを、対応する画像処理モジュール2602が画像処理を行うタイミングに合わせて出力する。これにより、それぞれのリードバッファ2611Rに記憶(保存)された画像データのデータ量は、対応する画像処理モジュール2602に出力した分だけ少なくなっていく。
 また、それぞれの画像処理モジュール2602は、対応するバスマスタ2611またはバスマスタ2613から出力された画像データに対して画像処理を行って生成した画像処理画像データを、対応するバスマスタ2611またはバスマスタ2613に出力する。図11に示したタイミングチャートの一例では、タイミングt1から、画像処理モジュール2602-3が、対応するリードバッファ2611R-3から取得した画像データに対して画像処理を行った画像データをバスマスタ2613-1に出力して、ライトバッファ2613W-1に順次記憶(保存)する場合を示している。このため、図11に示したタイミングチャートの一例では、タイミングt1から、ライトバッファ2613W-1に記憶(保存)される画像データのデータ量が増えていく。
 また、図11に示したタイミングチャートの一例では、画像処理モジュール2602-4が、バスマスタ2613-1を介して画像処理モジュール2602-3が出力した画像データを取得してさらに画像処理を行い、画像処理を行った画像データをバスマスタ2613-2に出力してライトバッファ2613W-2に順次記憶(保存)する場合を示している。このため、ライトバッファ2613W-2には、タイミングt1から、画像処理モジュール2602-4が行う画像処理の遅延時間(処理遅延時間)だけ遅れて、記憶(保存)される画像データのデータ量が増えていく。
 リードライト切り替え制御部2614は、リードバッファ2611Rおよびライトバッファ2613Wに記憶(保存)された画像データのデータ量を観測している。図11に示したタイミングチャートの一例では、タイミングt2のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、第1のライト切り替え閾値以上になっている。また、図11に示したタイミングチャートの一例では、タイミングt2のときに、リードバッファ2611R-1に記憶(保存)された画像データのデータ量が、第1のリード切り替え閾値以下になっている。このため、リードライト切り替え制御部2614は、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt2のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611-1から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2611-1は、リードバッファ2611R-1に記憶(保存)している画像データのデータ量が、画像処理開始可能データ量となったタイミングt3から、すぐにリードDMA転送を開始することができる。
 なお、図11に示したタイミングチャートの一例におけるタイミングt2のときのように、リードライト切り替え制御部2614が、リードライト切り替え信号RWによって、優先して行いたい方のDMA転送をリードDMA転送とライトDMA転送とのいずれにも変更することができる場合、現在のDRAM30の状態を維持する方が、データバス210における画像データの転送効率の低下を少なくする(抑える)上で好適である。このため、図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt2のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。しかし、リードライト切り替え制御部2614がDRAM30の現在の状態を維持させる方法は、上述したようなリードライト切り替え信号RWの状態を変更しない方法に限定されるものではない。例えば、リードライト切り替え制御部2614を、リードライト切り替え信号RWと共に、このリードライト切り替え信号RWが有効であるか無効であるかを表す信号を出力する構成にすることによって、バスアービタ231が画像処理部262からのアクセス要求を受け付ける(許可する)際に、無効なリードライト切り替え信号RWを参照しないようにさせてもよい。
 なお、図11に示したタイミングチャートの一例では、タイミングt3のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が、第1のライト切り替え閾値以上になっている。このため、リードライト切り替え制御部2614は、タイミングt3のときにも、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt3のときにも、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。そして、図11に示したタイミングチャートの一例では、バスマスタ2611-1がリードDMA転送を終了したタイミングt4のときに、リードバッファ2611R-2に記憶(保存)された画像データのデータ量が、第1のリード切り替え閾値以下になっている。このため、バスマスタ2611-2は、リードバッファ2611R-2に記憶(保存)している画像データのデータ量が、画像処理開始可能データ量となったタイミングから、すぐにリードDMA転送を開始することができる。
 また、図11に示したタイミングチャートの一例では、バスマスタ2611-2がリードDMA転送を終了したタイミングt5のときに、リードバッファ2611R-3に記憶(保存)された画像データのデータ量が、第1のリード切り替え閾値以下になっている。そして、図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt5のときにも、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。このため、バスマスタ2611-3は、リードバッファ2611R-3に記憶(保存)している画像データのデータ量が、画像処理開始可能データ量となったタイミングから、すぐにリードDMA転送を開始することができる。
 なお、図11に示したタイミングチャートの一例では、タイミングt5以降に、ライトバッファ2613W-1に記憶(保存)している画像データのデータ量が、「フル」の状態となっている。つまり、ライトバッファ2613W-1に、画像処理モジュール2602-3が出力した画像データを記憶(保存)する記憶容量に空きがない状態となっている。このため、画像処理モジュール2602-3は、対応するバスマスタ2613-1のライトバッファ2613W-1に、画像処理を行った後の画像データを記憶(保存)することができるようになるのを待っている状態で画像処理が停止している。このため、リードライト切り替え制御部2614は、バスマスタ2613-1によるライトDMA転送の緊急度が高いと判定する。
 このため、図11に示したタイミングチャートの一例では、バスマスタ2611-3がリードDMA転送を開始した後に、リードライト切り替え制御部2614が、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにし、緊急度信号URを、緊急度が高いことを表す“High”レベルにする。このため、バスマスタ2613-1は、バスマスタ2611-3がリードDMA転送を終了した後に、ライトDMA転送を開始することができる。図11に示したタイミングチャートの一例では、タイミングt6のときに、バスマスタ2611-3がリードDMA転送を終了している。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-1から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。そして、バスマスタ2613-1は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt7から、ライトDMA転送によって、ライトバッファ2613W-1に記憶(保存)された画像データをDRAM30に記憶させる(書き込む)。
 なお、タイミングt6のときにリードDMA転送を終了したバスマスタ2611-3のリードバッファ2611R-3は、記憶(保存)している画像データのデータ量が、「フル」の状態となっている。これは、対応する画像処理モジュール2602-3が、対応するバスマスタ2613-1のライトバッファ2613W-1に、画像処理を行った後の画像データを記憶(保存)することができるようになるのを待っている状態で画像処理が停止しているため、画像処理モジュール2602-3によってリードバッファ2611R-3に記憶(保存)している画像データの取得(読み出し)が行われないためである。しかし、リードバッファ2611R-3に記憶(保存)された画像データのデータ量は、バスマスタ2613-1がライトDMA転送を開始することによって、ライトバッファ2613W-1の記憶容量に空きができ、対応する画像処理モジュール2602-3が画像処理を再開した後から、画像処理モジュール2602-3に取得された(読み出された)分だけ少なくなっていく。図11に示したタイミングチャートの一例では、リードバッファ2611R-3に記憶(保存)された画像データのデータ量が、バスマスタ2613-1がライトDMA転送を開始したタイミングt7から少なくなっていく場合を示している。
 また、図11に示したタイミングチャートの一例では、タイミングt6のときに、ライトバッファ2613W-2に記憶(保存)している画像データのデータ量が、「フル」の状態となっている。つまり、ライトバッファ2613W-2にも、画像処理モジュール2602-4が出力した画像データを記憶(保存)する記憶容量に空きがない状態となっている。このため、画像処理モジュール2602-4も、対応するバスマスタ2613-2のライトバッファ2613W-2に、画像処理を行った後の画像データを記憶(保存)することができるようになるのを待っている状態で画像処理が停止している。このため、リードライト切り替え制御部2614は、バスマスタ2613-2によるライトDMA転送の緊急度が高いと判定する。従って、リードライト切り替え制御部2614は、バスマスタ2613-1がライトDMA転送を開始したタイミングt7のときにも、緊急度信号URを、緊急度が高いことを表す“High”レベルのままにする。
 その後、図11に示したタイミングチャートの一例では、タイミングt8のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、第1のライト切り替え閾値以上になっている。また、図11に示したタイミングチャートの一例では、タイミングt8のときに、バスマスタ2613-1がライトDMA転送を終了している。このため、リードライト切り替え制御部2614は、タイミングt8のときに、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。しかし、図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt8のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにし、緊急度信号URを、緊急度が高いことを表す“High”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-2から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2613-2は、タイミングt8から、すぐにライトDMA転送を開始することができる。
 その後、図11に示したタイミングチャートの一例では、バスマスタ2613-2がライトDMA転送を開始した後、リードライト切り替え制御部2614が、緊急度信号URを、緊急度が低いことを表す“Low”レベルにしている。
 その後、図11に示したタイミングチャートの一例では、タイミングt9のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、第1のライト切り替え閾値以上になっている。このため、バスマスタ2613-1は、ライトバッファ2613W-1にDMA転送開始可能データ量まで画像データが記憶(保存)されたタイミングから、すぐにライトDMA転送を開始することができる。
 その後、図11に示したタイミングチャートの一例では、タイミングt10のときに、バスマスタ2613-2がライトDMA転送を終了している。また、図11に示したタイミングチャートの一例では、タイミングt10のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、DMA転送開始可能データ量となっている。また、図11に示したタイミングチャートの一例では、タイミングt10のときに、リードバッファ2611R-2に記憶(保存)された画像データのデータ量が、第1のリード切り替え閾値以下になっている。このため、リードライト切り替え制御部2614は、タイミングt10のときにも、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt10のときにも、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにしている。このため、バスマスタ2613-1は、タイミングt10から、ライトDMA転送によって、ライトバッファ2613W-1に記憶(保存)された画像データをDRAM30に記憶させる(書き込む)。
 その後、図11に示したタイミングチャートの一例では、タイミングt11のときに、バスマスタ2613-1がライトDMA転送を終了している。また、図11に示したタイミングチャートの一例では、タイミングt11のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が、第1のライト切り替え閾値以上になっている。このため、バスマスタ2613-2は、ライトバッファ2613W-2にDMA転送開始可能データ量まで画像データが記憶(保存)されたタイミングから、すぐにライトDMA転送を開始することができる。
 その後、図11に示したタイミングチャートの一例では、タイミングt12のときに、バスマスタ2613-2がライトDMA転送を終了している。また、図11に示したタイミングチャートの一例では、タイミングt12のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、DMA転送開始可能データ量となっている。また、図11に示したタイミングチャートの一例では、タイミングt12のときに、リードバッファ2611R-3に記憶(保存)された画像データのデータ量が、第1のリード切り替え閾値以下になっている。このため、リードライト切り替え制御部2614は、タイミングt12のときにも、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。図11に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt12のときにも、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにしている。このため、バスマスタ2613-1は、ライトバッファ2613W-1にDMA転送開始可能データ量まで画像データが記憶(保存)されたタイミングから、すぐにライトDMA転送を開始することができる。
 図11に示したタイミングチャートの一例では、タイミングt12以降も同様に、リードライト切り替え制御部2614は、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにしている。このため、バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、ライトバッファ2613WにDMA転送開始可能データ量まで画像データが記憶(保存)されるごとにライトDMA転送を行って、ライトバッファ2613Wに記憶(保存)された画像データをDRAM30に記憶させる(書き込む)。
 図11に示したタイミングチャートの一例では、タイミングt13~タイミングt14と、タイミングt17~タイミングt18と、タイミングt21~タイミングt22とのそれぞれの期間にバスマスタ2613-1がライトDMA転送を行うタイミングを示している。また、図11に示したタイミングチャートの一例では、タイミングt16のときと、タイミングt20のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が第1のライト切り替え閾値以上になるタイミングを示している。また、図11に示したタイミングチャートの一例では、タイミングt15~タイミングt16と、タイミングt19~タイミングt20と、タイミングt23~タイミングt24とのそれぞれの期間にバスマスタ2613-2がライトDMA転送を行うタイミングを示している。また、図11に示したタイミングチャートの一例では、タイミングt14のときと、タイミングt18のときと、タイミングt22のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が第1のライト切り替え閾値以上になるタイミングを示している。
 なお、図11に示したタイミングチャートの一例では、タイミングt16のときに、リードバッファ2611R-1に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっている。つまり、リードバッファ2611R-1に記憶(保存)された画像データが空の状態となり、画像処理モジュール2602-1に画像処理を行う対象の画像データを出力することができない状態となっている。このため、画像処理モジュール2602-1は、画像処理を行うために必要な画像データが対応するバスマスタ2611-1のリードバッファ2611R-1に揃うのを待っている状態で画像処理が停止していると考えることができる。しかし、図11に示したタイミングチャートの一例においてタイミングt16のときにリードバッファ2611R-1に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっているのは、例えば、画像処理モジュール2602-1による1ブロック分の画像処理が完了したことによるものである。このため、リードライト切り替え制御部2614は、バスマスタ2611-1によるリードDMA転送の緊急度は低いと判定し、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにし、緊急度信号URを、緊急度が低いことを表す“Low”レベルのままにしている。これにより、バスアービタ231は、現在のDRAM30の状態を維持し、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-1またはバスマスタ2613-2から出力されたライトDMA転送のアクセス要求を受け付ける(許可する)。
 なお、図11に示したタイミングチャートの一例において、タイミングt16のときにリードバッファ2611R-1に記憶(保存)している画像データのデータ量が「エンプティ」の状態となっているのが、画像処理モジュール2602-1による1ブロック分の画像処理が完了したことによるものであるという情報は、例えば、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されてもよい。また、画像処理モジュール2602-1による1ブロック分の画像処理が完了したという情報は、例えば、画像処理モジュール2602-1が、現在の処理の状態を表す情報として、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。また、例えば、画像処理部262の内部または外部に、画像処理モジュール2602-1が実行している画像処理の状態(例えば、進捗など)を監視する構成要素を備えている場合には、この構成要素が、監視した画像処理の状態に基づいて、画像処理モジュール2602-1による1ブロック分の画像処理が完了したという情報を、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 なお、図11に示したタイミングチャートの一例では、タイミングt18のときに、リードバッファ2611R-2に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっている。また、図11に示したタイミングチャートの一例では、タイミングt21のときに、リードバッファ2611R-3に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっている。しかし、図11に示したタイミングチャートの一例においてタイミングt18のときにリードバッファ2611R-2に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっているのは、タイミングt16のときと同様に、例えば、画像処理モジュール2602-2による1ブロック分の画像処理が完了したことによるものである。また、図11に示したタイミングチャートの一例においてタイミングt21のときにリードバッファ2611R-3に記憶(保存)している画像データのデータ量が、「エンプティ」の状態となっているのも、タイミングt16やタイミングt18のときと同様に、例えば、画像処理モジュール2602-3による1ブロック分の画像処理が完了したことによるものである。このため、リードライト切り替え制御部2614は、タイミングt16のときと同様に、バスマスタ2611-2やバスマスタ2611-3によるリードDMA転送の緊急度は低いと判定し、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにし、緊急度信号URを、緊急度が低いことを表す“Low”レベルのままにしている。これにより、バスアービタ231は、タイミングt18やタイミングt21のときにも、現在のDRAM30の状態を維持し、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-1またはバスマスタ2613-2から出力されたライトDMA転送のアクセス要求を受け付ける(許可する)。
 なお、図11に示したタイミングチャートの一例において、タイミングt18やタイミングt21のときにそれぞれのリードバッファ2611Rに記憶(保存)している画像データのデータ量が「エンプティ」の状態となっているのが、対応する画像処理モジュール2602による1ブロック分の画像処理が完了したことによるものであるという情報も、例えば、CPU220によって、リードライト切り替え制御部2614のレジスタに設定されてもよい。また、それぞれの画像処理モジュール2602による1ブロック分の画像処理が完了したという情報は、それぞれの画像処理モジュール2602や、それぞれの画像処理モジュール2602が実行している画像処理の状態(例えば、進捗など)を監視する構成要素が、リードライト切り替え制御部2614に逐次設定または通知する構成であってもよい。
 その後、図11に示したタイミングチャートの一例では、バスマスタ2613-2がライトDMA転送を終了したタイミングt24のときに、リードライト切り替え制御部2614が、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにしている。このため、バスマスタ2611のそれぞれは、リードDMA転送を行うことができる。そして、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、それぞれのバスマスタ2611から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを書き込んでいる状態からデータを読み出す状態に切り替える。図11に示したタイミングチャートの一例では、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt25~タイミングt26の期間に、バスマスタ2611-1と、バスマスタ2611-2と、バスマスタ2611-3とのそれぞれが順次、リードDMA転送によって、画像処理の対象の画像データをDRAM30から取得する(読み出す)タイミングを示している。なお、図11に示したタイミングチャートの一例においてタイミングt25~タイミングt26の期間にそれぞれのバスマスタ2611がリードDMA転送によってDRAM30から取得する(読み出す)画像データは、例えば、それぞれのバスマスタ2611が、次のブロックの画像処理を行うための、画像処理の対象の画像データである。
 続いて、画像処理部262におけるDMA転送を第2の切り替え閾値に基づいて切り替える動作について説明する。より具体的には、リードライト切り替え制御部2614が、第2の切り替え閾値に基づいてリードライト切り替え信号RWを変更して(切り替えて)、バスマスタ2611-1~バスマスタ2611-3のそれぞれが行うリードDMA転送と、バスマスタ2613-1とバスマスタ2613-2とのそれぞれが行うライトDMA転送とを切り替える動作について説明する。図12は、本発明の第3の実施形態のメモリアクセス装置においてDMA転送を行う別のタイミングの一例を示したタイミングチャートである。
 図12には、図11に示した第1の切り替え閾値に基づいてDMA転送を切り替える動作のタイミングチャートの一例と同様に、バスマスタ2611に備えたリードバッファ2611Rと、バスマスタ2613に備えたライトバッファ2613Wとのそれぞれに記憶(保存)しているデータ量の変移で、DMA転送を切り替える動作のタイミングの一例を示している。なお、図12においても、図11に示したタイミングチャートの一例と同様に、リードバッファ2611Rとライトバッファ2613Wとのそれぞれの構成がダブルバッファの構成である場合のデータ量の変移を示している。
 また、図12には、図11に示したタイミングチャートの一例と同様に、リードライト切り替え制御部2614がバスアービタ231に出力するリードライト切り替え信号RWと、緊急度信号URと、バスアービタ231によって受け付けられる(許可される)DMA転送とのそれぞれのタイミングの一例を示している。なお、図12においても、リードライト切り替え信号RWが表すレベル、緊急度信号URが表すレベル、およびDMA転送のタイミングは、図11に示したタイミングチャートの一例と同様である。
 画像処理部262が画像データに対する画像処理を開始すると、図11に示したタイミングチャートの一例と同様に、バスマスタ2611-1と、バスマスタ2611-2と、バスマスタ2611-3とのそれぞれは、まず、リードDMA転送によって、画像処理の対象の画像データをDRAM30から取得する(読み出す)。このため、リードライト切り替え制御部2614は、リードDMA転送を優先することを通知する“High”レベルのリードライト切り替え信号RWを、バスアービタ231に出力する。また、リードライト切り替え制御部2614は、緊急度が低いことを表す“Low”レベルの緊急度信号URを、バスアービタ231に出力する。これにより、図11に示したタイミングチャートの一例と同様に、リードバッファ2611R-1と、リードバッファ2611R-2と、リードバッファ2611R-2とのそれぞれには、DRAM30から取得した(読み出した)画像データが、順次記憶(保存)される。
 そして、それぞれのリードバッファ2611Rに記憶(保存)された画像データのデータ量が、画像処理開始可能データ量以上になると、図11に示したタイミングチャートの一例と同様に、画像処理モジュール2602のそれぞれは、対応するリードバッファ2611Rに記憶(保存)された画像データを読み出して画像処理を行うことができるようになる。これにより、画像処理モジュール2602のそれぞれは、図11に示したタイミングチャートの一例と同様に、対応するバスマスタ2611またはバスマスタ2613から出力された画像データに対して画像処理を行って生成した画像データを、対応するバスマスタ2611またはバスマスタ2613に出力する。
 図12に示したタイミングチャートの一例では、図11に示したタイミングチャートの一例と同様に、タイミングt1から、画像処理モジュール2602-3が、対応するリードバッファ2611R-3から取得した画像データに対して画像処理を行った画像データをバスマスタ2613-1に出力して、ライトバッファ2613W-1に順次記憶(保存)する場合を示している。このため、図12に示したタイミングチャートの一例でも、図11に示したタイミングチャートの一例と同様に、タイミングt1から、ライトバッファ2613W-1に記憶(保存)される画像データのデータ量が増えていく。また、図12に示したタイミングチャートの一例でも、図11に示したタイミングチャートの一例と同様に、ライトバッファ2613W-2には、タイミングt1から、画像処理モジュール2602-4が行う画像処理の遅延時間(処理遅延時間)だけ遅れて、記憶(保存)される画像データのデータ量が増えていく。また、図12に示したタイミングチャートの一例でも、図11に示したタイミングチャートの一例と同様に、それぞれのリードバッファ2611Rに記憶(保存)された画像データのデータ量は、対応する画像処理モジュール2602に出力した分だけ少なくなっていく。
 リードライト切り替え制御部2614は、リードバッファ2611Rおよびライトバッファ2613Wに記憶(保存)された画像データのデータ量を観測している。図12に示したタイミングチャートの一例では、タイミングt2のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、第2のライト切り替え閾値以上になっている。このため、リードライト切り替え制御部2614は、タイミングt2のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにする。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-1から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。そして、バスマスタ2613-1は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt3から、ライトDMA転送によって、ライトバッファ2613W-1に記憶(保存)された画像データをDRAM30に記憶させる(書き込む)。
 このように、リードライト切り替え制御部2614は、第2のライト切り替え閾値に基づいて、ライトバッファ2613Wに記憶(保存)された画像データのデータ量がフルの状態、つまり、ライトバッファ2613Wの記憶容量が満杯の状態になる前のタイミングt2のときに、リードライト切り替え信号RWを変更する。なお、画像処理モジュール2602-3は、図11に示したタイミングチャートの一例と同様に、タイミングt2以降も、リードバッファ2611R-3に記憶(保存)された画像データを読み出して画像処理を行っている。従って、バスマスタ2613-1がライトDMA転送を開始する、つまり、DRAM30において切り替えに必要な所定の時間(一定時間)のロス時間が経過するタイミングt3までには、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量がフルの状態となる。これにより、バスマスタ2613-1は、ライトバッファ2613W-1の記憶容量が満杯になるまで画像データが記憶(保存)されるのを待つことなく、タイミングt3からライトDMA転送を開始することができる。このことにより、図11に示したタイミングチャートの一例と同様に、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量は、DRAM30に記憶された(書き込まれた)分だけ少なくなっていく。
 なお、図12に示したタイミングチャートの一例では、タイミングt3のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が、第2のライト切り替え閾値以上になっている。図12に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt3のときにも、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-2から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2613-2は、バスマスタ2613-1がライトDMA転送を終了した後に、ライトDMA転送を開始することができる。図12に示したタイミングチャートの一例では、タイミングt4のときに、バスマスタ2613-1がライトDMA転送を終了している。これにより、バスマスタ2613-2は、タイミングt4から、すぐにリードDMA転送を開始することができる。
 その後、図11に示したタイミングチャートの一例では、タイミングt5のときに、リードバッファ2611R-1に記憶(保存)された画像データのデータ量が、第2のリード切り替え閾値以下になっている。このため、リードライト切り替え制御部2614は、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。図12に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt5のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルにしている。このため、バスマスタ2611-1は、バスマスタ2613-2がライトDMA転送を終了した後に、リードDMA転送を開始することができる。図12に示したタイミングチャートの一例では、タイミングt6のときに、バスマスタ2613-2がライトDMA転送を終了している。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611-1から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを書き込んでいる状態からデータを読み出す状態に切り替える。そして、バスマスタ2611-1は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt7から、リードDMA転送によって、DRAM30から画像データを取得し(読み出し)、リードバッファ2611R-1に記憶(保存)する。
 このように、リードライト切り替え制御部2614は、第2のリード切り替え閾値に基づいて、リードバッファ2611R-1に記憶(保存)された画像データが空の状態、つまり、リードバッファ2611R-1の記憶容量が全て空きの状態になる前のタイミングt5のときに、リードライト切り替え信号RWを変更する。これにより、図12に示したタイミングチャートの一例のように、タイミングt7から、DRAM30から取得した(読み出した)画像データが、リードバッファ2611R-1に順次記憶(保存)され、リードバッファ2611R-1における画像データのデータ量は増えていく。
 その後、図12に示したタイミングチャートの一例では、タイミングt7のときに、リードバッファ2611R-2に記憶(保存)された画像データのデータ量が、第2のリード切り替え閾値以下になっている。図12に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt7のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611-2から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2611-2は、バスマスタ2611-1がリードDMA転送を終了した後に、リードDMA転送を開始することができる。図12に示したタイミングチャートの一例では、タイミングt8のときに、バスマスタ2611-1がリードDMA転送を終了している。これにより、バスマスタ2611-2は、タイミングt8から、すぐにリードDMA転送を開始することができる。
 また、図12に示したタイミングチャートの一例では、タイミングt8のときに、リードバッファ2611R-3に記憶(保存)された画像データのデータ量が、第2のリード切り替え閾値以下になっている。さらに、図12に示したタイミングチャートの一例では、タイミングt8のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が、第2のライト切り替え閾値以上になっている。このため、リードライト切り替え制御部2614は、リードライト切り替え信号RWを、リードDMA転送とライトDMA転送とのいずれか一方のDMA転送を優先することを通知する状態に変更することができる。
 なお、このままの状態が続くと、リードバッファ2611R-3に記憶(保存)された画像データを読み出して画像処理を行い、画像処理を行った後の画像データをバスマスタ2613-2のライトバッファ2613W-1に記憶(保存)する画像処理モジュール2602-3は、画像処理を行う対象の画像データがリードバッファ2611R-3に揃うのを待っている状態で、画像処理を停止することになる。さらに、画像処理モジュール2602-3は、画像処理を行った後の画像データをライトバッファ2613W-1に記憶(保存)することができるようになるのを待っている状態で、画像処理を停止することになる。
 この場合、リードライト切り替え制御部2614は、画像処理部262において予め定めた、それぞれのバスマスタ2611が行うリードDMA転送とそれぞれのバスマスタ2613が行うライトDMA転送との間の優先度に基づいて、優先して行うDMA転送を決定する。なお、画像処理部262では、バスマスタ2611-3が行うリードDMA転送の方が、バスマスタ2613-1が行うライトDMA転送よりも優先度が高くなっている。このため、図12に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt8のときに、リードライト切り替え信号RWを、リードDMA転送を優先することを通知する“High”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2611-2から出力されたリードDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2611-3は、バスマスタ2611-2がリードDMA転送を終了した後に、リードDMA転送を開始することができる。図12に示したタイミングチャートの一例では、タイミングt9のときに、バスマスタ2611-2がリードDMA転送を終了している。これにより、バスマスタ2611-3は、タイミングt9から、すぐにリードDMA転送を開始することができる。
 そして、図12に示したタイミングチャートの一例では、バスマスタ2611-3がリードDMA転送を開始した後に、リードライト切り替え制御部2614が、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルにし、緊急度信号URを、緊急度が高いことを表す“High”レベルにする。このため、バスマスタ2613-1は、バスマスタ2611-3がリードDMA転送を終了した後に、ライトDMA転送を開始することができる。図12に示したタイミングチャートの一例では、タイミングt10のときに、バスマスタ2611-3がリードDMA転送を終了している。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-1から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、DRAM30の状態を、データを読み出している状態からデータを書き込む状態に切り替える。そして、バスマスタ2613-1は、DRAM30の状態を切り替えるときに必要な所定(一定)のロス時間が経過したタイミングt11から、ライトDMA転送によって、ライトバッファ2613W-1に記憶(保存)された画像データをDRAM30に記憶させる(書き込む)。
 なお、タイミングt10のときにリードDMA転送を終了したバスマスタ2611-3のリードバッファ2611R-3は、記憶(保存)している画像データのデータ量が、「フル」の状態となっている。しかし、リードバッファ2611R-3に記憶(保存)された画像データのデータ量は、バスマスタ2613-1がライトDMA転送を開始し、対応する画像処理モジュール2602-3が画像処理を再開したことによって、画像処理モジュール2602-3に取得された(読み出された)分だけ少なくなっていく。図12に示したタイミングチャートの一例では、リードバッファ2611R-3に記憶(保存)された画像データのデータ量が、バスマスタ2613-1がライトDMA転送を開始したタイミングt11から少なくなっていく場合を示している。
 また、図12に示したタイミングチャートの一例では、タイミングt9のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が、第2のライト切り替え閾値以上になっている。そして、図12に示したタイミングチャートの一例では、バスマスタ2611-3がリードDMA転送を行っているときに、ライトバッファ2613W-2に記憶(保存)している画像データのデータ量が、「フル」の状態となっている。このため、リードライト切り替え制御部2614は、バスマスタ2613-2によるライトDMA転送の緊急度が高いと判定し、緊急度信号URを、緊急度が高いことを表す“High”レベルのままにする。
 その後、図12に示したタイミングチャートの一例では、タイミングt12のときに、バスマスタ2613-1がライトDMA転送を終了している。そして、図12に示したタイミングチャートの一例では、リードライト切り替え制御部2614が、タイミングt12のときに、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにし、緊急度信号URを、緊急度が高いことを表す“High”レベルのままにしている。これにより、バスアービタ231は、画像処理部262をDRAM30へのアクセス要求を受け付ける(許可する)処理ブロックとして決定するときに、バスマスタ2613-2から出力されたライトDMA転送のアクセス要求を受け付け(許可し)、現在のDRAM30の状態を維持する。これにより、バスマスタ2613-2は、タイミングt12から、すぐにライトDMA転送を開始することができる。
 その後、図12に示したタイミングチャートの一例では、バスマスタ2613-2がライトDMA転送を開始した後、リードライト切り替え制御部2614が、緊急度信号URを、緊急度が低いことを表す“Low”レベルにしている。
 その後、図12に示したタイミングチャートの一例では、タイミングt13のときに、バスマスタ2613-2がライトDMA転送を終了している。なお、図12に示したタイミングチャートの一例では、タイミングt13以降も同様に、リードライト切り替え制御部2614は、リードライト切り替え信号RWを、ライトDMA転送を優先することを通知する“Low”レベルのままにしている。このため、バスマスタ2613-1とバスマスタ2613-2とのそれぞれは、ライトバッファ2613Wに記憶(保存)された画像データのデータ量が第2のライト切り替え閾値以上になり、その後、記憶(保存)している画像データのデータ量が、「フル」の状態となったタイミングから、すぐにライトDMA転送を開始することができる。
 図12に示したタイミングチャートの一例では、タイミングt14のときに、ライトバッファ2613W-1に記憶(保存)された画像データのデータ量が第2のライト切り替え閾値以上になり、その後、タイミングt15のときに、記憶(保存)している画像データのデータ量が、「フル」の状態となって、バスマスタ2613-1がライトDMA転送を開始しているタイミングを示している。また、図12に示したタイミングチャートの一例では、タイミングt16のときに、ライトバッファ2613W-2に記憶(保存)された画像データのデータ量が第2のライト切り替え閾値以上になり、バスマスタ2613-1がライトDMA転送を終了したタイミングt17から、すぐにバスマスタ2613-2がリードDMA転送を開始しているタイミングを示している。
 このような構成および動作によって、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2614が、バスマスタ2611によるリードDMA転送の状態と、バスマスタ2613によるライトDMA転送の状態とを観測する。そして、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、優先して行いたいDMA転送を通知するためのリードライト切り替え信号RWを、バスアービタ231に出力する。このとき、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、リードバッファ2611Rおよびライトバッファ2613Wの記憶容量にある程度の余裕をもった状態で、リードライト切り替え信号RWを変更する。そして、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、バスアービタ231が、バスマスタ2611からのリードDMA転送のアクセス要求、またはバスマスタ2613からのライトDMA転送のアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知されたDMA転送のアクセス要求を受け付ける(許可する)。これにより、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、DRAM30におけるデータを読み出している状態からデータを書き込む状態への切り替えや、データを書き込んでいる状態からデータを読み出す状態への切り替えを適切に行うことができる。このことにより、第3の実施形態のメモリアクセス装置でも、第1の実施形態のおよび第2の実施形態のメモリアクセス装置と同様に、DRAM30の状態を切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなくなる。
 また、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、画像処理モジュール2602が行う画像処理に関するパラメータと、観測したバスマスタ2611およびバスマスタ2613におけるそれぞれのDMA転送の状態から、それぞれのDMA転送の緊急度を判定して、緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。そして、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、バスアービタ231が、それぞれの処理ブロックからのアクセス要求を調停する際に、緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。これにより、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、画像処理部261が実行する画像処理の緊急度が高くなった場合に、バスアービタ231が、リードライト切り替え信号RWに基づいて、バスマスタ2611またはバスマスタ2613からのアクセス要求を優先して受け付ける(許可する)ことができる。このことにより、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、画像処理モジュール2602による一連の画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 これらのことにより、第3の実施形態のメモリアクセス装置を搭載したシステム(撮像装置3や画像処理装置22)でも、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)と同様に、システムに破綻をきたす要因となり得るデータバス210における画像データの転送効率の低下を抑えることができる。このことにより、第3の実施形態のメモリアクセス装置を搭載したシステム(撮像装置3や画像処理装置22)でも、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)と同様に、第3の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602が、一連の画像処理を円滑に行うことができる。
 なお、図11および図12では、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いてリードライト切り替え信号RWを変更し(切り替え)、バスマスタ2611が行うリードDMA転送とバスマスタ2613が行うライトDMA転送とを切り替える動作について説明した。しかし、画像処理部262におけるDMA転送を切り替える動作は、第1の切り替え閾値または第2の切り替え閾値のいずれか一方の切り替え閾値を用いる動作に限定されるものではなく、第1の切り替え閾値と第2の切り替え閾値との両方の切り替え閾値を用いて、バスマスタ2611が行うリードDMA転送とバスマスタ2613が行うライトDMA転送とを切り替えてもよい。つまり、リードライト切り替え制御部2614は、第1の切り替え閾値と第2の切り替え閾値との両方の切り替え閾値を用いた2段階で、バスマスタ2611に備えたリードバッファ2611Rと、バスマスタ2613に備えたライトバッファ2613Wとのそれぞれに記憶(保存)しているデータ量を判定し、優先して行いたいDMA転送を通知するリードライト切り替え信号RWの状態を変更する構成であってもよい。なお、この場合においてバスマスタ2611が行うリードDMA転送とバスマスタ2613が行うライトDMA転送とを切り替える動作は、図11に示した第1の切り替え閾値に基づいてDMA転送を切り替える動作と、図12に示した第2の切り替え閾値に基づいてDMA転送を切り替える動作とから容易に理解することができるため、詳細な説明は省略する。
 上述したように、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、DRAM30との間で双方向(書き込みおよび読み出し)のDMA転送を行う際に、リードライト切り替え制御部2614が、バスマスタ2611およびバスマスタ2613におけるDMA転送の状態を観測する。そして、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、優先して行いたい方のDMA転送を通知するためのリードライト切り替え信号RWを、早いタイミングでバスアービタ231に出力する。これにより、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、DRAM30の状態の切り替えを適切に行って、バスアービタ231が、バスマスタ2611またはバスマスタ2613からのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号RWによって通知された方のDMA転送のアクセス要求を受け付ける(許可する)ことができる。これにより、第3の実施形態のメモリアクセス装置でも、第1の実施形態および第2の実施形態のメモリアクセス装置と同様に、DRAM30の状態を切り替えるときなどに必要な所定の時間(一定時間)のロス時間を必要以上に増加させることがなく、データバス210における画像データの転送効率の低下を少なくして(抑えて)、画像処理モジュール2602による画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 また、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、リードライト切り替え制御部2614が、画像処理モジュール2602が行う画像処理に関するパラメータと、観測したバスマスタ2611およびバスマスタ2613におけるそれぞれのDMA転送の状態から、それぞれのDMA転送の緊急度を判定する。そして、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、判定したそれぞれのDMA転送の緊急度を通知するための緊急度信号URを、バスアービタ231に出力する。これにより、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、バスアービタ231が、画像処理部261に備えたそれぞれの処理ブロックからのアクセス要求を調停する際に、リードライト切り替え制御部2614から出力された緊急度信号URに応じて、画像処理部261からのアクセス要求を受け付ける(許可する)優先度を高くして調停を行うことができる。このことにより、第3の実施形態のメモリアクセス装置でも、第2の実施形態のメモリアクセス装置と同様に、画像処理部261が実行する画像処理の緊急度が高くなった場合に、バスアービタ231が、リードライト切り替え信号RWに基づいて、バスマスタ2611またはバスマスタ2613からのアクセス要求を優先して受け付け(許可し)、画像処理モジュール2602による一連の画像処理や、DRAM30との間でのDMA転送を、円滑に行うことができる。
 これらのことにより、第3の実施形態のメモリアクセス装置を搭載したシステム(撮像装置3や画像処理装置22)でも、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)と同様に、システムに破綻をきたす要因となり得るデータバス210における画像データの転送効率の低下を抑えることができる。このことにより、第3の実施形態のメモリアクセス装置を搭載したシステム(撮像装置3や画像処理装置22)でも、第2の実施形態のメモリアクセス装置を搭載したシステム(撮像装置2や画像処理装置21)と同様に、第3の実施形態のメモリアクセス装置がDRAM30との間で受け渡しを行う画像データに対して処理を行う画像処理モジュール2602が、一連の画像処理を円滑に行うことができる。
 上記に述べたように、本発明の各実施形態によれば、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、本発明のメモリアクセス装置を構成するバスマスタによるDMA転送の状態を観測する。より具体的には、リードライト切り替え制御部が、バスマスタによるDMA転送のアクセス要求と、バスマスタに備えたリードバッファとライトバッファとのそれぞれに記憶(保存)されている画像データのデータ量とのそれぞれを観測することによって、バスマスタによるDMA転送の状態を観測する。そして、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、観測した本発明のメモリアクセス装置を構成するバスマスタによるDMA転送の状態に基づいて、読み出しのDMA転送(リードDMA転送)と書き込みのDMA転送(ライトDMA転送)との内、いずれのDMA転送を優先して行うかを判定する。このとき、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、いずれのDMA転送を優先して行うかを判定するための切り替え閾値(第1の切り替え閾値または第2の切り替え閾値)を生成する。そして、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、生成した切り替え閾値を用いて、本発明のメモリアクセス装置を構成するバスマスタに備えたリードバッファとライトバッファとのそれぞれに記憶(保存)されている画像データのデータ量を判定する。そして、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、判定した結果に基づいて、読み出しのDMA転送(リードDMA転送)と書き込みのDMA転送(ライトDMA転送)との内、優先して行いたい方のDMA転送を通知するためのリードライト切り替え信号を、本発明のメモリアクセス装置を構成するバスアービタに出力する。これにより、本発明の各実施形態では、本発明のメモリアクセス装置がアクセスするDRAMにおけるデータを読み出している状態からデータを書き込む状態への切り替えや、データを書き込んでいる状態からデータを読み出す状態への切り替えを、適切に行うことができる。そして、本発明の各実施形態では、本発明のメモリアクセス装置を構成するバスアービタが、本発明のメモリアクセス装置を構成するバスマスタからのアクセス要求を受け付ける(許可する)際に、リードライト切り替え信号によって通知された優先して行いたいDMA転送のアクセス要求を受け付ける(許可する)。これにより、本発明の各実施形態では、本発明のメモリアクセス装置がDRAMとの間で受け渡しを行う画像データに対して処理を行う画像処理モジュールによる画像処理や、DRAMとの間でのDMA転送を、円滑に行うことができる。
 また、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、画像処理モジュールが行う画像処理に関するパラメータと、観測した本発明のメモリアクセス装置を構成するバスマスタにおけるDMA転送の状態から、それぞれのDMA転送の緊急度を判定する。そして、本発明の各実施形態では、本発明のメモリアクセス装置を構成するリードライト切り替え制御部が、判定したDMA転送の緊急度を通知するための緊急度信号を、本発明のメモリアクセス装置を構成するバスアービタに出力する。これにより、本発明の各実施形態では、本発明のメモリアクセス装置を構成するバスアービタが、本発明のメモリアクセス装置を構成するバスマスタからのアクセス要求を調停する際に、緊急度信号に応じて、本発明のメモリアクセス装置を構成するバスマスタからのアクセス要求を受け付ける(許可する)優先度を高くして調停を行う。これにより、本発明の各実施形態では、本発明のメモリアクセス装置を構成するバスマスタによるDMA転送の緊急度が高くなった場合に、本発明のメモリアクセス装置を構成するバスアービタが、リードライト切り替え信号によって通知された優先して行いたいDMA転送のアクセス要求を受け付ける(許可する)。これにより、本発明の各実施形態では、本発明のメモリアクセス装置がDRAMとの間で受け渡しを行う画像データに対して処理を行う画像処理モジュールによる画像処理や、DRAMとの間でのDMA転送を、円滑に行うことができる。
 これらのことにより、本発明の各実施形態では、本発明のメモリアクセス装置を搭載したシステムにおいて、システムに破綻をきたす要因となり得るDRAMとの間で画像データをやり取りするデータバスにおける画像データの転送効率の低下を少なくする(抑える)ことができる。そして、本発明の各実施形態では、本発明のメモリアクセス装置がDRAMとの間で受け渡しを行う画像データに対して処理を行う画像処理モジュールによる一連の画像処理を円滑に行うことができる。
 なお、本発明の各実施形態では、本発明のメモリアクセス装置を、撮像装置に1つ備える構成について説明した。しかし、本発明のメモリアクセス装置を備えるシステムにおいて本発明のメモリアクセス装置を備える数は、本発明の各実施形態において示した1つに限定されるものではなく、本発明のメモリアクセス装置を複数備えてもよい。この場合、本発明のメモリアクセス装置を構成するバスアービタは、複数の本発明のメモリアクセス装置で共通した1つのみを備える構成であってもよい。つまり、本発明のメモリアクセス装置を構成するバスマスタとリードライト切り替え制御部との組を複数備え、本発明のメモリアクセス装置を構成する1つのバスアービタが、それぞれのリードライト切り替え制御部から出力されるリードライト切り替え信号や緊急度信号に基づいて、それぞれのバスマスタからのアクセス要求を調停する構成であってもよい。
 なお、本発明の各実施形態では、本発明のメモリアクセス装置が、撮像装置に搭載される画像処理装置に備えられる構成について説明した。しかし、DRAMとの間でデータの転送を行うメモリアクセス装置を備えるシステムは、本発明の各実施形態において示した画像処理装置や撮像装置の他にも種々のシステムが考えられる。従って、本発明の考え方に基づいたメモリアクセス装置を適用することができる処理装置やシステムは、何ら限定されるものではない。すなわち、DRAMとの間でデータの転送を行う処理装置やシステムであれば、いかなる処理装置やシステムであっても、本発明のメモリアクセス装置における考え方を同様に適用することができる。そして、本発明のメモリアクセス装置と同様の効果を得ることができる。
 以上、本発明の好ましい実施形態を説明したが、本発明はこれら実施形態およびその変形例に限定されることはない。本発明の趣旨を逸脱しない範囲で、構成の付加、省略、置換、およびその他の変更をすることができる。
 また、本発明は前述した説明によって限定されることはなく、添付のクレームの範囲によってのみ限定される。
 上記各実施形態によれば、複数の処理ブロックがDRAMを共有する場合に、DRAMからのデータの読み出しとDRAMへのデータの書き込みとの切り替えを適切に行って、システムに破綻をきたす要因を削減することができる。
 1,2,3 撮像装置(撮像装置)
 10 イメージセンサ(撮像装置)
 20,21,22 画像処理装置(撮像装置,画像処理装置)
 210 データバス(撮像装置,画像処理装置)
 220 CPU(撮像装置,画像処理装置)
 230,231 バスアービタ(画像処理装置,メモリアクセス装置,バスアービタ)
 240 DRAMインターフェース部(画像処理装置,メモリアクセス装置,バスアービタ)
 250 前処理部(撮像装置,画像処理装置)
 260,261,262 画像処理部(画像処理装置,メモリアクセス装置,バスマスタ,リードライト切り替え制御部)
 2601 バスマスタ(画像処理装置,メモリアクセス装置,バスマスタ)
 2601R,2611R,2611R-1,2611R-2,2611R-3 リードバッファ(画像処理装置,メモリアクセス装置,バスマスタ,リードバッファ)
 2601W,2613W,2613W-1,2613W-2 ライトバッファ(画像処理装置,メモリアクセス装置,バスマスタ,ライトバッファ)
 2602,2602-1,2602-2,2602-3,2602-4 画像処理モジュール(処理モジュール)
 2603,2614 リードライト切り替え制御部(画像処理装置,メモリアクセス装置,リードライト切り替え制御部)
 2611,2611-1,2611-2,2611-3 バスマスタ(画像処理装置,メモリアクセス装置,バスマスタ,リードバスマスタ)
 2613,2613-1,2613-2 バスマスタ(画像処理装置,メモリアクセス装置,バスマスタ,ライトバスマスタ)
 270 表示処理部(撮像装置,画像処理装置)
 30 DRAM(メモリ,撮像装置)
 40 表示装置(撮像装置)

Claims (15)

  1.  データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、
     前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、
     前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、
     を備える、
     メモリアクセス装置。
  2.  前記リードライト切り替え制御部は、
     前記バスマスタから出力された前記リードアクセス要求の状態と、
     前記バスマスタから出力された前記ライトアクセス要求の状態と、
     前記バスマスタに備えた、前記メモリから読み出した予め定めたデータ量のデータを保存するリードバッファに保存されたデータのデータ量と、
     前記バスマスタに備えた、前記メモリに書き込む予め定めたデータ量のデータを保存するライトバッファに保存されたデータのデータ量と、
     を観測し、
     前記バスマスタにおける前記アクセス要求において、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するためのリードライト切り替え信号を出力し、
     前記バスアービタは、
     前記バスマスタから出力された前記アクセス要求を受け付ける際に、前記リードライト切り替え信号によって通知された優先する前記アクセス要求を受け付ける、
     請求項1に記載のメモリアクセス装置。
  3.  前記バスマスタは、少なくとも、
     前記リードバッファを備え、前記リードアクセス要求を出力するリードバスマスタと、
     前記ライトバッファを備え、前記ライトアクセス要求を出力するライトバスマスタと、
     によって構成される、
     請求項2に記載のメモリアクセス装置。
  4.  前記リードライト切り替え制御部は、
     観測したそれぞれの状態に基づいて、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための切り替え閾値を生成し、
     前記リードバッファに保存されたデータのデータ量、および前記ライトバッファに保存されたデータのデータ量を、前記切り替え閾値を用いて判定し、前記リードバッファに保存されたデータのデータ量、または前記ライトバッファに保存されたデータのデータ量が、前記切り替え閾値に到達したと判定したときに、前記リードライト切り替え信号が表す優先する前記アクセス要求を切り換える、
     請求項2または請求項3に記載のメモリアクセス装置。
  5.  前記切り替え閾値は、
     前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記リードバッファに保存されたデータに対して処理を行う処理モジュールが、前記リードバッファに保存されたデータを読み出して処理を開始することができるデータ量と、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量とを加えたリード切り替え閾値と、
     前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに保存されたデータの前記メモリへの書き込みを開始することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いたライト切り替え閾値と、
     から構成されている、
     請求項4に記載のメモリアクセス装置。
  6.  前記切り替え閾値は、
     前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記リードバッファに保存されたデータに対して処理を行う処理モジュールが、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量と、前記メモリから読み出したデータを前記リードバッファの全ての記憶容量に保存するまでの間に処理を行うことができるデータ量とを加えたリード切り替え閾値と、
     前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに前記処理モジュールが処理を行った後のデータを保存することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いたライト切り替え閾値と、
     から構成されている、
     請求項4に記載のメモリアクセス装置。
  7.  前記リードライト切り替え制御部は、
     観測したそれぞれの状態に基づいて、前記リードバッファに保存されたデータを読み出して処理を行い、処理を行った後のデータを前記ライトバッファに保存する処理モジュールに、処理が待たされている状態が発生しているか否かと、前記データバスを介して受け渡しが行われているデータのデータ量が予め定めたデータ量よりも多いか否かとを判定し、
     前記処理モジュールに処理が待たされている状態が発生していない、または、前記処理モジュールに処理が待たされている状態が発生しているが、前記データバスを介して受け渡しが行われているデータのデータ量が前記予め定めたデータ量よりも多くないと判定した場合に、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための第1の切り替え閾値を生成し、
     前記処理モジュールに処理が待たされている状態が発生しており、前記データバスを介して受け渡しが行われているデータのデータ量が前記予め定めたデータ量よりも多いと判定した場合に、前記リードアクセス要求と前記ライトアクセス要求とのいずれの前記アクセス要求を優先するかを判定するための第2の切り替え閾値を生成し、
     前記リードバッファに保存されたデータのデータ量、および前記ライトバッファに保存されたデータのデータ量を、前記第1の切り替え閾値および前記第2の切り替え閾値のいずれか一方または両方を用いて判定し、前記リードバッファに保存されたデータのデータ量、または前記ライトバッファに保存されたデータのデータ量が、判定に用いた切り替え閾値に到達したと判定したときに、前記リードライト切り替え信号が表す優先する前記アクセス要求を切り換える、
     請求項2または請求項3に記載のメモリアクセス装置。
  8.  前記第1の切り替え閾値は、
     前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記処理モジュールが、前記リードバッファに保存されたデータを読み出して処理を開始することができるデータ量と、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量とを加えた第1のリード切り替え閾値と、
     前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに保存されたデータの前記メモリへの書き込みを開始することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いた第1のライト切り替え閾値と、
     から構成され、
     前記第2の切り替え閾値は、
     前記リードバッファに保存されたデータのデータ量の判定に用いられ、前記処理モジュールが、前記メモリをデータを書き込んでいる状態からデータを読み出す状態に切り替えるときに必要な時間の間に処理を行うことができるデータ量と、前記メモリから読み出したデータを前記リードバッファの全ての記憶容量に保存するまでの間に処理を行うことができるデータ量とを加えた第2のリード切り替え閾値と、
     前記ライトバッファに保存されたデータのデータ量の判定に用いられ、前記ライトバッファに前記処理モジュールが処理を行った後のデータを保存することができるデータ量から、前記メモリをデータを読み出している状態からデータを書き込む状態に切り替えるときに必要な時間の間に前記処理モジュールが処理を行うことができるデータ量を引いた第2のライト切り替え閾値と、
     から構成されている、
     請求項7に記載のメモリアクセス装置。
  9.  前記リードライト切り替え制御部は、
     予め設定された前記処理モジュールが行う処理に関する設定を用いて、前記バスマスタが出力した前記アクセス要求の緊急度を判定するための緊急度閾値を算出し、
     観測したそれぞれの状態に基づいて算出した、前記バスマスタが出力した前記アクセス要求が前記バスアービタに受け付けられていない前記アクセス要求の待ち時間が、前記緊急度閾値よりも長い場合に緊急度が高く、前記緊急度閾値よりも長くない場合に緊急度が低いことを通知するための緊急度信号を出力し、
     前記バスアービタは、
     前記メモリへのアクセス要求を調停する際に、前記緊急度信号によって緊急度が高いことが通知された前記バスマスタから出力された前記アクセス要求の優先度を高くして調停する、
     請求項5から請求項8のいずれか1項に記載のメモリアクセス装置。
  10.  前記緊急度閾値は、
     前記処理モジュールが行う処理が待たされる状態が発生しないように規定した、前記バスマスタによる前記メモリへのアクセスが終了するまでの限界の時間に、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記限界の時間に対する割合を乗算した時間の閾値である、
     請求項9に記載のメモリアクセス装置。
  11.  前記緊急度閾値は、
     前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値である、
     請求項9に記載のメモリアクセス装置。
  12.  前記緊急度閾値は、
     前記処理モジュールが処理を複数回に分けて行う場合において、
     前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける残りの処理の回数から求められる残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値である、
     請求項9に記載のメモリアクセス装置。
  13.  前記緊急度閾値は、
     前記処理モジュールが処理を処理の量が異なる複数回に分けて行う場合において、
     前記処理モジュールにおける処理の速度および処理の量と、前記処理モジュールが行う処理を終了させるまでに要求される要求処理時間と、前記メモリの状態を切り替えるときに必要な時間に基づいて設定した前記要求処理時間に対する割合と、前記処理モジュールにおける全体の処理の量と現在まで終了した処理の量から求められる残りの処理の量と、前記処理モジュールが処理を開始してから現在までの処理時間と、に基づいて算出される時間の閾値である、
     請求項9に記載のメモリアクセス装置。
  14.  データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、
     前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、
     前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、
     を具備したメモリアクセス装置、
     を備える、
     画像処理装置。
  15.  データバスに接続されたメモリへのアクセスを要求するアクセス要求を出力するバスマスタと、
     前記バスマスタがアクセスする前記メモリのデータに対する処理の停止を予測し、前記バスマスタにおける前記アクセス要求の内、前記メモリからデータを読み出すリードアクセスを要求するリードアクセス要求と、前記メモリにデータを書き込むライトアクセスを要求するライトアクセス要求とのいずれの前記アクセス要求を優先するかを通知するリードライト切り替え制御部と、
     前記データバスに接続され、前記メモリへのアクセス要求を調停し、前記バスマスタから出力された前記メモリへの前記アクセス要求を受け付ける際に、前記リードライト切り替え制御部によって通知された優先する前記アクセス要求を受け付け、受け付けたアクセス要求に応じて前記メモリへのアクセスを制御するバスアービタと、
     を具備したメモリアクセス装置を備える画像処理装置、
     を備える、
     撮像装置。 
PCT/JP2017/031108 2017-08-30 2017-08-30 メモリアクセス装置、画像処理装置、および撮像装置 WO2019043822A1 (ja)

Priority Applications (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/031108 WO2019043822A1 (ja) 2017-08-30 2017-08-30 メモリアクセス装置、画像処理装置、および撮像装置

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/JP2017/031108 WO2019043822A1 (ja) 2017-08-30 2017-08-30 メモリアクセス装置、画像処理装置、および撮像装置

Publications (1)

Publication Number Publication Date
WO2019043822A1 true WO2019043822A1 (ja) 2019-03-07

Family

ID=65525778

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/JP2017/031108 WO2019043822A1 (ja) 2017-08-30 2017-08-30 メモリアクセス装置、画像処理装置、および撮像装置

Country Status (1)

Country Link
WO (1) WO2019043822A1 (ja)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2021111583A1 (ja) * 2019-12-05 2021-06-10
CN114286035A (zh) * 2021-12-29 2022-04-05 杭州海康机器人技术有限公司 图像采集卡、图像采集方法及图像采集系统

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011180656A (ja) * 2010-02-26 2011-09-15 Kyocera Mita Corp インタフェース装置、画像形成装置
JP2014228915A (ja) * 2013-05-20 2014-12-08 ヤマハ株式会社 データ処理装置
JP2016085683A (ja) * 2014-10-28 2016-05-19 京セラドキュメントソリューションズ株式会社 メモリーアクセス装置、メモリーアクセス制御方法

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2011180656A (ja) * 2010-02-26 2011-09-15 Kyocera Mita Corp インタフェース装置、画像形成装置
JP2014228915A (ja) * 2013-05-20 2014-12-08 ヤマハ株式会社 データ処理装置
JP2016085683A (ja) * 2014-10-28 2016-05-19 京セラドキュメントソリューションズ株式会社 メモリーアクセス装置、メモリーアクセス制御方法

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPWO2021111583A1 (ja) * 2019-12-05 2021-06-10
JP7381603B2 (ja) 2019-12-05 2023-11-15 オリンパス株式会社 データ転送装置およびデータ転送方法
US11842071B2 (en) 2019-12-05 2023-12-12 Olympus Corporation Data transfer device and data transfer method
CN114286035A (zh) * 2021-12-29 2022-04-05 杭州海康机器人技术有限公司 图像采集卡、图像采集方法及图像采集系统
CN114286035B (zh) * 2021-12-29 2024-01-05 杭州海康机器人股份有限公司 图像采集卡、图像采集方法及图像采集系统

Similar Documents

Publication Publication Date Title
US10241721B2 (en) Image processing device and image processing method
US20190079881A1 (en) Memory access control device, image processing device, and imaging device
US20190324646A1 (en) Memory access device, image-processing device, and imaging device
TW201830374A (zh) 資料傳送裝置及資料傳送方法
JP5591022B2 (ja) バス帯域モニタ装置およびバス帯域モニタ方法
US10719458B2 (en) Data transfer device, image processing device, and imaging device
JP2014238769A (ja) データ処理装置およびデータ転送制御装置
WO2019043822A1 (ja) メモリアクセス装置、画像処理装置、および撮像装置
JP2007088806A (ja) 画像信号処理装置及び画像信号処理方法
JP5993267B2 (ja) 画像処理装置
US11314664B2 (en) Memory access device, image processing device and imaging device
JP6539509B2 (ja) データ転送装置およびデータ転送方法
WO2012111825A1 (ja) 画像処理装置、画像処理方法、及びプログラム
US9043514B2 (en) Data transfer device and method
JP6564625B2 (ja) データ転送装置およびデータ転送方法
JP4640434B2 (ja) デジタルカメラ
JP4633290B2 (ja) データ処理装置及びその装置におけるアクセス調停方法
WO2020008522A1 (ja) バス調停装置、バス調停システム、および撮像装置
JP2017157883A (ja) 画像処理装置
JP2017162431A (ja) メモリ制御装置及び撮像装置
JP5224492B2 (ja) 画像データ転送制御装置及び画像データ転送方法並びに該画像データ転送装置を有するカメラ
JP3494436B2 (ja) 画像処理装置
JP2012043053A (ja) バス帯域モニタ装置およびバス帯域モニタ方法
JP2015102912A (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: 17923372

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: 17923372

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: JP