edumips64 | Free cross-platform educational MIPS64 CPU Simulator
kandi X-RAY | edumips64 Summary
Support
Quality
Security
License
Reuse
- Open memory
- Converts a hexadecimal string into a relative long value
- Writes some bytes to a file
- Read a number of bytes from a file
- Run the CPU
- Determines if this cycle is valid
- Returns the cycle element to be updated
- Update the cycle
- This method is used to process the procedure
- Create the appearance panel
- Gets the cell s rectangle
- Add the buttons
- Paint the grid
- Computes the SMTP
- Performs the reduction
- This method performs EXECUTE
- Compute the SMTP
- Performs an atomic operation
- Converts a hexadecimal string to a relative short value
- Converts hexadecimal string to relative long value
- Initialize the module
- Update the columns
- Perform EXEC operation
- Build the rounding panel
- Link a list of artifacts to a JavaScript function
- Perform the EXOR operation
edumips64 Key Features
edumips64 Examples and Code Snippets
import numpy as np import imgaug.augmenters as iaa # Standard scenario: You have N=16 RGB-images and additionally one segmentation # map per image. You want to augment each image and its heatmaps identically. images = np.random.randint(0, 255, (16, 128, 128, 3), dtype=np.uint8) segmaps = np.random.randint(0, 10, size=(16, 64, 64, 1), dtype=np.int32) seq = iaa.Sequential([ iaa.GaussianBlur((0, 3.0)), iaa.Affine(translate_px={"x": (-40, 40)}), iaa.Crop(px=(0, 10)) ]) images_aug, segmaps_aug = seq(images=images, segmentation_maps=segmaps)
def segment_fish(image): """Attempts to segment the clown fish out of the provided image.""" hsv_image = cv2.cvtColor(image, cv2.COLOR_RGB2HSV) light_orange = (1, 190, 200) dark_orange = (18, 255, 255) mask = cv2.inRange(hsv_image, light_orange, dark_orange) light_white = (0, 0, 200) dark_white = (145, 60, 255) mask_white = cv2.inRange(hsv_image, light_white, dark_white) final_mask = mask + mask_white result = cv2.bitwise_and(image, image, mask=final_mask) result = cv2.GaussianBlur(result, (7, 7), 0) return result
Trending Discussions on edumips64
Trending Discussions on edumips64
QUESTION
The documentation for this program is extremely limited. There's almost nothing i can draw from in order to do that. Along with the PDF of the program there's only this:
.data
format_str: .asciiz "%dth of %s:\n%s version %i.%i is being tested!"
s1: .asciiz "June"
s2: .asciiz "EduMIPS64"
fs_addr: .space 4
.word 5
s1_addr: .space 4
s2_addr: .space 4
.word 0
.word 5
test:
.code
daddi r5, r0, format_str
sw r5, fs_addr(r0)
daddi r2, r0, s1
daddi r3, r0, s2
sd r2, s1_addr(r0)
sd r3, s2_addr(r0)
daddi r14, r0, fs_addr
syscall 5
syscall 0
You can check it out here. EDU/WINMIPS64 is very different from regular MIPS assembly
There are a couple of paragraphs explaining this, that are of not much help. At any rate, this here prints a formatted string, along with some string parameters (stored in s1 and s2) and integer parameters (where are they stored?).
I have two arrays stored in memory. I have personally executed instructions upon them and now i want to print them. How do i supply on such a formatted string these two integers (which are double words, ie. needing 8 bytes to be stored)? The help material doesn't explain.
This is the code that i have managed to create up to this point (heavily commented):
....
dadd $s4, $zero, $zero ; i = 0
printOutput: ; print results from the 2 arrays
beq $s4, 960, end ; if (i = size = 960 / 8) goto end
dadd $s1, $s4, $s2 ; full address of 1st array
dadd $s0, $s4, $s3 ; full address of 2nd array
daddi $a3, $zero, printString ; address ofstring to be printed stored in $a3
ld $v0, 0($s1) ; $v0 will be used to print 1st array[i]. Is this right?
ld $v1, 0($s2) ; $v1 will be used to print 2nd array[i]. Is this right? Which register to use for supplying a formatted string to print integers? It is not explained anywhere!
dadd $14, $zero, $a3 ; print string. $14 is the register to syscall instructions. But i'm just guessing with this. I really don't know how it should handle. I just supplied $a3 because it seems more intuitive.
syscall 5 ; prints ouput (on the MEM stage)
daddi $s4, $s4, 8 ; i++
j printOutput
end:
If anyone knows how to do this, i would be very greatful if he/she could share. There's not any examples on this anywhere. Thanks.
UPDATE
With the help of Michael and by trial and error i found the main cause of the problem. The sequence where we supply the labels for the output string and other memory addresses is very sensitive. By trial and error i found that we must obey the following order:
.data
format_string .asciiz "%d and %i etc.."
start_address .space 4
syscallArg1 .space 4 ; 1st parameter to syscall 5
syscallArg2 .space 4 ; 2nd parameter to syscall 5
---other labels go here---
.text
---code---
Note that we have to supply to $14
the start_address label, which must not contain anything (just some available empty space). Before this one the formatted string must go and after this one the arguments to the syscall 5
must lie. Other labels can go afterwards, or before all those.
ANSWER
Answered 2017-May-02 at 14:58What the manual says is that you should store the address of the format string, followed by zero or more parameters (e.g. an integer or a string address), in continuous memory, and then load the starting address of that memory into r14
before executing sycall 5
.
Their example code looks slightly incorrect to me, because they should be using sw
rather than sd
to store r2
and r3
in memory (assuming that the string addresses actually fit in 32 bits).
So you need to reserve some space in the data section, and then store first the address of your format string, followed by any parameters. And then place the starting address of that piece of memory in r14
. For example, if your format string was "%d, %d"
and the two values you want to print are in r2
and r3
you would sw
r2
and r3
directly after where you store the address of the format string.
For example:
.data
format_str: .asciiz "%d"
printf_args: .space 8
...
.code
daddi r5, r0, format_str
sw r5, printf_args(r0)
daddi r5, r0, 123
sw r5, printf_args+4(r0)
daddi r14, r0, printf_args
syscall 5
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install edumips64
You can use edumips64 like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the edumips64 component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .
Support
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesExplore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits
Save this library and start creating your kit
Share this Page