Skip to content
This repository was archived by the owner on Dec 13, 2022. It is now read-only.

Uart semantics and proofs (cont'd)#888

Merged
samuelgruetter merged 9 commits intoproject-oak:mainfrom
dayeol:uart-semantics-5
Aug 16, 2021
Merged

Uart semantics and proofs (cont'd)#888
samuelgruetter merged 9 commits intoproject-oak:mainfrom
dayeol:uart-semantics-5

Conversation

@dayeol
Copy link
Copy Markdown
Contributor

@dayeol dayeol commented Aug 12, 2021

This completes the spec & proof of the following functions (#889)

  • uart_putchar
  • uart_tx_full

The function has 2 while loops: at the beginning to make sure the tx FIFO is not full, and at the end to ensure the device is back to IDLE state.
For now, it has been proven with the precondition where the device state is always IDLE when we enter the function.
This makes the first loop iterate exactly once.
It makes sense in a single-threaded environment because the only way to make the device busy is via uart_putchar,
but the function waits the device to be IDLE state before it returns.
However, we could also generalize it by relaxing the precondition to be execution tr s for any state s,
and it would be pretty straightforward to prove that too -- s can be destructed, and if s is IDLE we just do the same thing, and if s is BUSY then we can prove that at some point the loop should break leaving the device in IDLE state.

Dayeol Lee added 4 commits August 5, 2021 13:47
Specification & proofs has been added for the following functions:
- bitfield_field32_write
- bitfield_bit32_write

The postcondition just states that the return value is basically what is
computed in the function body, which might be not very useful for its
callers. We will add or modify the postcondition later if needed.
Copy link
Copy Markdown
Contributor

@jadephilipoom jadephilipoom left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The UART proofs look good, great work! However, I want to resolve the point about IncrementWait before merging.

@google-cla
Copy link
Copy Markdown

google-cla bot commented Aug 16, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@dayeol
Copy link
Copy Markdown
Contributor Author

dayeol commented Aug 16, 2021

@googlebot I signed it!

@samuelgruetter
Copy link
Copy Markdown
Contributor

It seems that @jadephilipoom's as well as my requested changes have been addressed, or turned into new issues, so I'm going to merge this now, so that I can make my next PR on top of it.

@samuelgruetter samuelgruetter merged commit 2c19e09 into project-oak:main Aug 16, 2021
@samuelgruetter
Copy link
Copy Markdown
Contributor

Thanks @dayeol for dealing with all my nitpicks 😉

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants