Skip to content

Conversation

0mega28
Copy link
Owner

@0mega28 0mega28 commented Mar 21, 2022

No description provided.

periperidip and others added 8 commits March 21, 2022 14:31
Since the job of a TLB is to deliver a physical frame number
corresponding to a virtual page number, assume that the physical address
is equal to the virtual address irrespective of the instruction type,
i.e., read or write.

This assumption is made for the simplicity of the simulation and is in
fact technically inaccurate.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
The TLB stores a bit describing the validity of a block. A block is
valid when it is filled in the TLB.

Introduce block validity by adding the boolean parameter 'is_valid' and
supply appropriate helper functions '{set,get}_block_validity()'.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
The TLB produces a physical frame number corresponding to a virtual page
number iff a block is valid. Introduce the functionality in the form of
an extra 'if' statement check.

While at it, rename the function 'Set::set_block()' to
'Set::insert_block()' for clarity.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
Rename the function 'set_block()' to 'insert_block()' for clarity. While
at it, amend the usage of 'Set::insert_block()' as well.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
To initialise a TLB block, the function 'Block::set()' was used. To
avoid confusion with the set existing in cache terminologies, rename the
function 'set()' to 'init()'.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
To circumvent the sequential page table entry search, introduce
'get_frame_number_short()' which simply returns the frame number
corresponding to a page number. This also significantly curtails the
simulator runtime.

Co-authored-by: Abhay Kumar <abhay98394@gmail.com>
Co-authored-by: Shourya Shukla <periperidip@gmail.com>
A block is termed as 'valid' as soon as its entry is added in the TLB.
Therefore, validate the block as soon as it is initialised using the
'Block::init()' function by setting 'is_valid' as true.

Reported-by: Saksham Gupta <sakshamdam54321@gmail.com>
Signed-off-by: Shourya Shukla <periperidip@gmail.com>
@0mega28 0mega28 merged commit 5e2e5a5 into master Mar 21, 2022
@0mega28 0mega28 deleted the shourya branch March 21, 2022 09:08
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.

2 participants