Forum Discussion
Altera_Forum
Honored Contributor
9 years agoYou'll either need to use the internal register file or consume multiple custom instructions to pass the information. I don't recall the internal register file having macro support so I typically use use the 'n' bus input to perform different operations with the same hardware. For example n = 0 you can pass the first two input, n = 1 you can pass the next to inputs, etc.... n = 3 pass the last two inputs and execute the edge detect and return a value. Again the custom instruction user guide documents all this stuff so I would read it since we aren't going to type 40+ pages worth of information into a forum post.
Edge detection is typically something you operate across an entire frame so performing this operation with a series of custom instruction calls seems inefficient to me. I would have an edge detection block that fetches the entire frame from memory and performs all the operations at once then returns the result to the processor instead of having the processor sending this work to the hardware a piece at a time.