The Shahnamah of Firdowsi is an epic historial poem, and thus basically a work of historical fiction covering thousands of years of Persian history, semi history, legend, and myth.
As I remember, it mentions Darius III, the last Achaemenid king of kings (r. 336-330 BC), and Alexander the Great (r. 336-323 BC), so it includes more or less real and historical events at least as far back as then.
However, the Shahnamah gives a rather romanticized and only partally accurate version of events as recent as the Sassanid Dynasty of AD 224-651.
The Achaemenid Dynasty or First Persian Empire ruled from 550 BC to 330 BC. And befoe that there were kings and kingdoms and dynasties within the borders of Modern Iran - and other regions in Asia where Iranian languages were spoken - for thousands of years. Usually there were many kingdoms at a time in that large region.
And there were recorded kings and dynasties in western parts of Iran, bordering the highly literate Mesopotamia, for one or two thousand years before 550 BC.
But there would be little historical record of kingdoms speaking Iranian languages farther east in Iran or in central Asia, becuse those kingdoms were far from the nearest literate societies and had little contact with them.
Zoroaster (/ˈzɒroʊæstər/, UK also /ˌzɒroʊˈæstər/; Greek: Ζωροάστρης, Zōroastrēs), also known as Zarathustra (/ˌzærəˈθuːstrə/, UK also /ˌzɑːrə-/; Avestan: 𐬰𐬀𐬭𐬀𐬚𐬎𐬱𐬙𐬭𐬀, Zaraθuštra), Zarathushtra Spitama or Ashu Zarathushtra (Modern Persian: زرتشت, Zartosht), was an ancient Iranian prophet (spiritual leader) who founded what is now known as Zoroastrianism. His teachings challenged the existing traditions of the Indo-Iranian religion and inaugurated a movement that eventually became the dominant religion in Ancient Persia. He was a native speaker of Old Avestan and lived in the eastern part of the Iranian Plateau, but his exact birthplace is uncertain.2
There is no scholarly consensus on when he lived.2 Some scholars, using linguistic and socio-cultural evidence, suggest a dating to somewhere in the second millennium BCE. Other scholars date him in the 7th and 6th century BCE as a near-contemporary of Cyrus the Great and Darius I. Zoroastrianism eventually became the official religion of Ancient Persia and its distant subdivisions from the 6th century BCE to the 7th century CE. Zoroaster is credited with authorship of the Gathas as well as the Yasna Haptanghaiti, hymns composed in his native dialect, Old Avestan and which comprise the core of Zoroastrian thinking. Most of his life is known from these texts.3 By any modern standard of historiography, no evidence can place him into a fixed period and the historicization surrounding him may be a part of a trend from before the 10th century CE that historicizes legends and myths.
Zoroaster probably live in the eastern part of the Iranian cultural area. So local kings mentioned in connection with Zoroaster may have lived in that region years, decades, centuries or millennia before the Achaemenid Dynasty conquered much of it.
So possibly king Vishtapa who may have supported Zoroaster could be Vishtapa or Hystapes, father of King of Kings Darius I the Great. Or possibly Zoroaster's Vishtapa lived a thousand years earlier.
I read somewhere that the Shahnamah covers a specific number of years, over 3,000, but I forget the exact number of years. Presumably someone added up the lengths of the reigns of all the Iranian monarchs or other time spans mentioned.
If the Shahnamah ends about 651 AD, which is the same as HE 10,651, subtracting 3,000 to 4,000 years would give about HE 6651 to HE 7651 for the beginning of the Shahnamah. That is equivalent to 3349 BC to 2349 BC.
I don't remember much about the mythical era, but I do remember that the reign of Jamshid lasted for 700 years and was followed by the reign of Zahhak lasting for 1,000 years. So even if there hadn't been reigns before Jamshid the reign of Zahhak would end in the period 1649 BC to 649 BC. And actually it would end centuries later than that, allowing for the earlier reigns mentioned.
So the heroic age of the Shahnamah should last from sometime in or after the period of 1649 to 649 BC to the conquest by Alexander the Great in 330 BC. And counting up the lengths of the reigns in that age should indicated when it began.
According to the Shahnamah, the last Kayanian monarch was Dara or Darab II, who reigned for 14 to 16 years. He is usually identified with Darius III who reigned for 6 years (336-330 BC).
Dara II was the son and successor of Dara I. Darius III was the successor of Artaxerxes IV (r.338-336 BC) and the son of Arsames. son of Ostenes, son of Darius II (r. 424-402 BC). Darius II was son of Artaxerxes I (r. 465-424 BC), son of Xerxes I (r. 486-465 BC), son of Darius I The Great (r. 522-586 BC).
And possibly Dara i was based on Artazerxes IV and/or other precicessors of Darius iii, and possibly Dara I was based on Darius II and/or Darius I.
Dara I was supposedly the son of Kay Bahman.
The 3rd-6th century Sassanians claimed to descend from Bahman and the Kayanids. This myth was combined with another legend in which the Sassanians were imagined to have descended from the Achaemenids, and in the post-Sassanid period Bahman came to equated with both Artaxerxes I and Cyrus the Great.4
The length of his reign varies; the Middle Persian Bundahishn and most of the Arabic and Persian sources note 112 years, others note 120 and yet others 80 years.1
If Kay Bahman was based on Cyrus the Great (r. 559-530 BC) and Artaxerxes I (r. 465-424 BC), and possibly other real persons, it would be no wonder that some sources claim he reigned for over 100 years.
So my best guess is that the Pishdadian rulers, if based at all on historical persons, are based on ancient eastern Iranian kings, and that the earlier Kayanian rulers may be based on later but pre Achaemenid eastern Iranian kings, and the later few Kayanian rulers may be based on Achaemenid kings.
And I suspect tha there are many different theories about the Kyaanian kings.
And here is a link to an article on the Kayanian dynasty in the online Encylopedia Iranica