It is a general observation that porosity of rocks decrease with increasing burial depth. To model this trend, Athy's law is widely used since 1930. However, this kind of phenomenological porosity-depth relation fails to account for the involved mechanisms explicitly. Among others, the increased effective stress with increasing depth is a key factor to dominate the porosity-depth trend. In addition, uplift and erosion may alter the normal trend. This study proposed an effect stress/stress history-dependent porosity model of sedimentary rock based on laboratory measurement. The results fit well with the porosity-depth relation derived from density log measured in borehole. It is interesting to find the porosity increased abruptly with increasing depth near the Sanyi fault. This observed abnormal trend is reasonably captured by the proposed model. It is indicated that the proposed model, which take the effect of uplift and erosion on the porosity into account, is potentially useful to predict the porosity-depth relation in a sedimentary basin.