Both “dreamed” and “dreamt” are correct past terms of the word “dream”, and are often used interchangeably. However, “dreamed” is commonly used in Anglophone countries, except Britain. In Britain, “dreamt” is more commonly used.
Both can be used to refer to dreaming while asleep, and can be used interchangeably, depending on where you live. If you live in the U.S, for example, you’re more likely to say:
“I dreamed of libraries last night”
When referring to an aspiration, an abstraction that connotes hope, “dreamt” is more commonly used in Britain.
“Tobi has always dreamt of becoming an astronaut”.