Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bug when checking seg fit or overlap in the phys memory #32

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

thasinaz
Copy link

segments mayoverlap or out of the phys memory

out of phys memory:

> ./segmentation.py -a 16 -p 128 -A 1,14,15 --b0 127 --l0 2 --b1 0 --l1 2 -c
ARG seed 0
ARG address space size 16
ARG phys mem size 128

Segment register information:

  Segment 0 base  (grows positive) : 0x0000007f (decimal 127)
  Segment 0 limit                  : 2

  Segment 1 base  (grows negative) : 0x00000000 (decimal 0)
  Segment 1 limit                  : 2

Virtual Address Trace
  VA  0: 0x00000001 (decimal:    1) --> VALID in SEG0: 0x00000080 (decimal:  128)
  VA  1: 0x0000000e (decimal:   14) --> VALID in SEG1: 0x-0000002 (decimal:   -2)
  VA  2: 0x0000000f (decimal:   15) --> VALID in SEG1: 0x-0000001 (decimal:   -1)

and overlap:

./segmentation.py -a 16 -p 128 -A 1,15 --b0 64 --l0 2 --b1 66 --l1 5 -c
ARG seed 0
ARG address space size 16
ARG phys mem size 128

Segment register information:

  Segment 0 base  (grows positive) : 0x00000040 (decimal 64)
  Segment 0 limit                  : 2

  Segment 1 base  (grows negative) : 0x00000042 (decimal 66)
  Segment 1 limit                  : 5

Virtual Address Trace
  VA  0: 0x00000001 (decimal:    1) --> VALID in SEG0: 0x00000041 (decimal:   65)
  VA  1: 0x0000000f (decimal:   15) --> VALID in SEG1: 0x00000041 (decimal:   65)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant